diff --git a/google-cloud-ai_platform-v1/.owlbot-manifest.json b/google-cloud-ai_platform-v1/.owlbot-manifest.json index 8e3a1c3d83d8..a109278809e8 100644 --- a/google-cloud-ai_platform-v1/.owlbot-manifest.json +++ b/google-cloud-ai_platform-v1/.owlbot-manifest.json @@ -216,6 +216,22 @@ "lib/google/cloud/ai_platform/v1/prediction_service/rest.rb", "lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb", "lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/client.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/client.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/service_stub.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_service.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_service/client.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_service/credentials.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_service/operations.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_service/paths.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/client.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/operations.rb", + "lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/service_stub.rb", "lib/google/cloud/ai_platform/v1/rest.rb", "lib/google/cloud/ai_platform/v1/schedule_service.rb", "lib/google/cloud/ai_platform/v1/schedule_service/client.rb", @@ -384,6 +400,11 @@ "lib/google/cloud/aiplatform/v1/prediction_service_pb.rb", "lib/google/cloud/aiplatform/v1/prediction_service_services_pb.rb", "lib/google/cloud/aiplatform/v1/publisher_model_pb.rb", + "lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb.rb", + "lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb.rb", + "lib/google/cloud/aiplatform/v1/reasoning_engine_pb.rb", + "lib/google/cloud/aiplatform/v1/reasoning_engine_service_pb.rb", + "lib/google/cloud/aiplatform/v1/reasoning_engine_service_services_pb.rb", "lib/google/cloud/aiplatform/v1/reservation_affinity_pb.rb", "lib/google/cloud/aiplatform/v1/saved_query_pb.rb", "lib/google/cloud/aiplatform/v1/schedule_pb.rb", @@ -511,6 +532,9 @@ "proto_docs/google/cloud/aiplatform/v1/pipeline_state.rb", "proto_docs/google/cloud/aiplatform/v1/prediction_service.rb", "proto_docs/google/cloud/aiplatform/v1/publisher_model.rb", + "proto_docs/google/cloud/aiplatform/v1/reasoning_engine.rb", + "proto_docs/google/cloud/aiplatform/v1/reasoning_engine_execution_service.rb", + "proto_docs/google/cloud/aiplatform/v1/reasoning_engine_service.rb", "proto_docs/google/cloud/aiplatform/v1/reservation_affinity.rb", "proto_docs/google/cloud/aiplatform/v1/saved_query.rb", "proto_docs/google/cloud/aiplatform/v1/schedule.rb", @@ -836,6 +860,13 @@ "snippets/prediction_service/stream_raw_predict.rb", "snippets/prediction_service/streaming_predict.rb", "snippets/prediction_service/streaming_raw_predict.rb", + "snippets/reasoning_engine_execution_service/query_reasoning_engine.rb", + "snippets/reasoning_engine_execution_service/stream_query_reasoning_engine.rb", + "snippets/reasoning_engine_service/create_reasoning_engine.rb", + "snippets/reasoning_engine_service/delete_reasoning_engine.rb", + "snippets/reasoning_engine_service/get_reasoning_engine.rb", + "snippets/reasoning_engine_service/list_reasoning_engines.rb", + "snippets/reasoning_engine_service/update_reasoning_engine.rb", "snippets/schedule_service/create_schedule.rb", "snippets/schedule_service/delete_schedule.rb", "snippets/schedule_service/get_schedule.rb", @@ -995,6 +1026,13 @@ "test/google/cloud/ai_platform/v1/prediction_service_paths_test.rb", "test/google/cloud/ai_platform/v1/prediction_service_rest_test.rb", "test/google/cloud/ai_platform/v1/prediction_service_test.rb", + "test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_paths_test.rb", + "test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_rest_test.rb", + "test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_test.rb", + "test/google/cloud/ai_platform/v1/reasoning_engine_service_operations_test.rb", + "test/google/cloud/ai_platform/v1/reasoning_engine_service_paths_test.rb", + "test/google/cloud/ai_platform/v1/reasoning_engine_service_rest_test.rb", + "test/google/cloud/ai_platform/v1/reasoning_engine_service_test.rb", "test/google/cloud/ai_platform/v1/schedule_service_operations_test.rb", "test/google/cloud/ai_platform/v1/schedule_service_paths_test.rb", "test/google/cloud/ai_platform/v1/schedule_service_rest_test.rb", diff --git a/google-cloud-ai_platform-v1/gapic_metadata.json b/google-cloud-ai_platform-v1/gapic_metadata.json index 3e56b4b1de56..f16c998d857b 100644 --- a/google-cloud-ai_platform-v1/gapic_metadata.json +++ b/google-cloud-ai_platform-v1/gapic_metadata.json @@ -1466,6 +1466,59 @@ } } }, + "ReasoningEngineExecutionService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client", + "rpcs": { + "QueryReasoningEngine": { + "methods": [ + "query_reasoning_engine" + ] + }, + "StreamQueryReasoningEngine": { + "methods": [ + "stream_query_reasoning_engine" + ] + } + } + } + } + }, + "ReasoningEngineService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client", + "rpcs": { + "CreateReasoningEngine": { + "methods": [ + "create_reasoning_engine" + ] + }, + "GetReasoningEngine": { + "methods": [ + "get_reasoning_engine" + ] + }, + "ListReasoningEngines": { + "methods": [ + "list_reasoning_engines" + ] + }, + "UpdateReasoningEngine": { + "methods": [ + "update_reasoning_engine" + ] + }, + "DeleteReasoningEngine": { + "methods": [ + "delete_reasoning_engine" + ] + } + } + } + } + }, "ScheduleService": { "clients": { "grpc": { diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1.rb index 42c2bcca7f0d..08a8e1337534 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1.rb @@ -40,6 +40,8 @@ require "google/cloud/ai_platform/v1/notebook_service" require "google/cloud/ai_platform/v1/persistent_resource_service" require "google/cloud/ai_platform/v1/pipeline_service" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service" +require "google/cloud/ai_platform/v1/reasoning_engine_service" require "google/cloud/ai_platform/v1/schedule_service" require "google/cloud/ai_platform/v1/specialist_pool_service" require "google/cloud/ai_platform/v1/tensorboard_service" diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb index 69cc10353da9..6137b59a1ba9 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb index e0473982fd0d..30998ab3031e 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb index ed113f459f27..ca5bb2926fcd 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb index 038ccb721bca..a0e5589d00ce 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb index 13a3ce9380b0..8fec8b441b54 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb index a91fe39308b8..c14677217ee2 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb index 36b3457546f8..f0dc0cf2c2cd 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb index 011926b835d8..309d98a74bf7 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb index d7111af08d12..56a6f2963a16 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb index c41eb59d15df..7016f0b3837c 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb index 00869e569182..9659accc45b3 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb index d7bb16363fb6..af71ade5efb8 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb index a69c748ad7f7..467ba674283a 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb index 1f59711cc17b..9de8fae878f4 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb index 8f798e5e35de..57edf0f9f02b 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb index 799cde52d251..3b69ab613c85 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service.rb new file mode 100644 index 000000000000..ff9ca72cb6a1 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/client" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for executing queries on Reasoning Engine. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/reasoning_engine_execution_service" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new + # + module ReasoningEngineExecutionService + end + end + end + end +end + +helper_path = ::File.join __dir__, "reasoning_engine_execution_service", "helpers.rb" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/helpers" if ::File.file? helper_path diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/client.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/client.rb new file mode 100644 index 000000000000..d8c579fd9272 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + ## + # Client for the ReasoningEngineExecutionService service. + # + # A service for executing queries on Reasoning Engine. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :reasoning_engine_execution_service_stub + + ## + # Configure the ReasoningEngineExecutionService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ReasoningEngineExecutionService clients + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AIPlatform", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineExecutionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @reasoning_engine_execution_service_stub.universe_domain + end + + ## + # Create a new ReasoningEngineExecutionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ReasoningEngineExecutionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @reasoning_engine_execution_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @reasoning_engine_execution_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_execution_service_stub.endpoint + config.universe_domain = @reasoning_engine_execution_service_stub.universe_domain + config.logger = @reasoning_engine_execution_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_execution_service_stub.endpoint + config.universe_domain = @reasoning_engine_execution_service_stub.universe_domain + config.logger = @reasoning_engine_execution_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @reasoning_engine_execution_service_stub.logger + end + + # Service calls + + ## + # Queries using a reasoning engine. + # + # @overload query_reasoning_engine(request, options = nil) + # Pass arguments to `query_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload query_reasoning_engine(name: nil, input: nil, class_method: nil) + # Pass arguments to `query_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param input [::Google::Protobuf::Struct, ::Hash] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @param class_method [::String] + # Optional. Class method to be used for the query. + # It is optional and defaults to "query" if unspecified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest.new + # + # # Call the query_reasoning_engine method. + # result = client.query_reasoning_engine request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse. + # p result + # + def query_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.query_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.query_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.query_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_execution_service_stub.call_rpc :query_reasoning_engine, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Streams queries using a reasoning engine. + # + # @overload stream_query_reasoning_engine(request, options = nil) + # Pass arguments to `stream_query_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stream_query_reasoning_engine(name: nil, input: nil, class_method: nil) + # Pass arguments to `stream_query_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param input [::Google::Protobuf::Struct, ::Hash] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @param class_method [::String] + # Optional. Class method to be used for the stream query. + # It is optional and defaults to "stream_query" if unspecified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Api::HttpBody>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Api::HttpBody>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest.new + # + # # Call the stream_query_reasoning_engine method to start streaming. + # output = client.stream_query_reasoning_engine request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Api::HttpBody + # output.each do |current_response| + # p current_response + # end + # + def stream_query_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.stream_query_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.stream_query_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stream_query_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_execution_service_stub.call_rpc :stream_query_reasoning_engine, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ReasoningEngineExecutionService API. + # + # This class represents the configuration for ReasoningEngineExecutionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # query_reasoning_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.query_reasoning_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.query_reasoning_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ReasoningEngineExecutionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `query_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :query_reasoning_engine + ## + # RPC-specific configuration for `stream_query_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_query_reasoning_engine + + # @private + def initialize parent_rpcs = nil + query_reasoning_engine_config = parent_rpcs.query_reasoning_engine if parent_rpcs.respond_to? :query_reasoning_engine + @query_reasoning_engine = ::Gapic::Config::Method.new query_reasoning_engine_config + stream_query_reasoning_engine_config = parent_rpcs.stream_query_reasoning_engine if parent_rpcs.respond_to? :stream_query_reasoning_engine + @stream_query_reasoning_engine = ::Gapic::Config::Method.new stream_query_reasoning_engine_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials.rb new file mode 100644 index 000000000000..f590472d9f4e --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + # Credentials for the ReasoningEngineExecutionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths.rb new file mode 100644 index 000000000000..7b9349865376 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + # Path helper methods for the ReasoningEngineExecutionService API. + module Paths + ## + # Create a fully-qualified ReasoningEngine resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # + # @param project [String] + # @param location [String] + # @param reasoning_engine [String] + # + # @return [::String] + def reasoning_engine_path project:, location:, reasoning_engine: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reasoningEngines/#{reasoning_engine}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest.rb new file mode 100644 index 000000000000..0a12b5841df3 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for executing queries on Reasoning Engine. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new + # + module ReasoningEngineExecutionService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/client.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/client.rb new file mode 100644 index 000000000000..ee4a54eddcaf --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/client.rb @@ -0,0 +1,564 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + module Rest + ## + # REST client for the ReasoningEngineExecutionService service. + # + # A service for executing queries on Reasoning Engine. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :reasoning_engine_execution_service_stub + + ## + # Configure the ReasoningEngineExecutionService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ReasoningEngineExecutionService clients + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AIPlatform", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineExecutionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @reasoning_engine_execution_service_stub.universe_domain + end + + ## + # Create a new ReasoningEngineExecutionService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ReasoningEngineExecutionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @reasoning_engine_execution_service_stub = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @reasoning_engine_execution_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_execution_service_stub.endpoint + config.universe_domain = @reasoning_engine_execution_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @reasoning_engine_execution_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_execution_service_stub.endpoint + config.universe_domain = @reasoning_engine_execution_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @reasoning_engine_execution_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @reasoning_engine_execution_service_stub.logger + end + + # Service calls + + ## + # Queries using a reasoning engine. + # + # @overload query_reasoning_engine(request, options = nil) + # Pass arguments to `query_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload query_reasoning_engine(name: nil, input: nil, class_method: nil) + # Pass arguments to `query_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param input [::Google::Protobuf::Struct, ::Hash] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @param class_method [::String] + # Optional. Class method to be used for the query. + # It is optional and defaults to "query" if unspecified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest.new + # + # # Call the query_reasoning_engine method. + # result = client.query_reasoning_engine request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse. + # p result + # + def query_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.query_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.query_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.query_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_execution_service_stub.query_reasoning_engine request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Streams queries using a reasoning engine. + # + # @overload stream_query_reasoning_engine(request, options = nil) + # Pass arguments to `stream_query_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stream_query_reasoning_engine(name: nil, input: nil, class_method: nil) + # Pass arguments to `stream_query_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param input [::Google::Protobuf::Struct, ::Hash] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @param class_method [::String] + # Optional. Class method to be used for the stream query. + # It is optional and defaults to "stream_query" if unspecified. + # @return [::Enumerable<::Google::Api::HttpBody>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest.new + # + # # Call the stream_query_reasoning_engine method to start streaming. + # output = client.stream_query_reasoning_engine request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Api::HttpBody + # output.each do |current_response| + # p current_response + # end + # + def stream_query_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.stream_query_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.stream_query_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stream_query_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Api::HttpBody, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @reasoning_engine_execution_service_stub.stream_query_reasoning_engine request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ReasoningEngineExecutionService REST API. + # + # This class represents the configuration for ReasoningEngineExecutionService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # query_reasoning_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.query_reasoning_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.query_reasoning_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ReasoningEngineExecutionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `query_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :query_reasoning_engine + ## + # RPC-specific configuration for `stream_query_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_query_reasoning_engine + + # @private + def initialize parent_rpcs = nil + query_reasoning_engine_config = parent_rpcs.query_reasoning_engine if parent_rpcs.respond_to? :query_reasoning_engine + @query_reasoning_engine = ::Gapic::Config::Method.new query_reasoning_engine_config + stream_query_reasoning_engine_config = parent_rpcs.stream_query_reasoning_engine if parent_rpcs.respond_to? :stream_query_reasoning_engine + @stream_query_reasoning_engine = ::Gapic::Config::Method.new stream_query_reasoning_engine_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/service_stub.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/service_stub.rb new file mode 100644 index 000000000000..918445e5724c --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/service_stub.rb @@ -0,0 +1,199 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + module Rest + ## + # REST service stub for the ReasoningEngineExecutionService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the query_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse] + # A result object deserialized from the server's reply + def query_reasoning_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_query_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "query_reasoning_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the stream_query_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def stream_query_reasoning_engine request_pb, options = nil, &block + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stream_query_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "stream_query_reasoning_engine", + options: options, + is_server_streaming: true, + &block + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # @private + # + # GRPC transcoding helper method for the query_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_query_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:query", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stream_query_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stream_query_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:streamQuery", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service.rb new file mode 100644 index 000000000000..d8d5009c32a0 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" + +require "google/cloud/ai_platform/v1/reasoning_engine_service/credentials" +require "google/cloud/ai_platform/v1/reasoning_engine_service/paths" +require "google/cloud/ai_platform/v1/reasoning_engine_service/operations" +require "google/cloud/ai_platform/v1/reasoning_engine_service/client" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's Reasoning Engines. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/reasoning_engine_service" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/reasoning_engine_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + module ReasoningEngineService + end + end + end + end +end + +helper_path = ::File.join __dir__, "reasoning_engine_service", "helpers.rb" +require "google/cloud/ai_platform/v1/reasoning_engine_service/helpers" if ::File.file? helper_path diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/client.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/client.rb new file mode 100644 index 000000000000..5fada823d79e --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/client.rb @@ -0,0 +1,914 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/reasoning_engine_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + ## + # Client for the ReasoningEngineService service. + # + # A service for managing Vertex AI's Reasoning Engines. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :reasoning_engine_service_stub + + ## + # Configure the ReasoningEngineService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ReasoningEngineService clients + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AIPlatform", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @reasoning_engine_service_stub.universe_domain + end + + ## + # Create a new ReasoningEngineService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ReasoningEngineService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/aiplatform/v1/reasoning_engine_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @reasoning_engine_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @reasoning_engine_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_service_stub.endpoint + config.universe_domain = @reasoning_engine_service_stub.universe_domain + config.logger = @reasoning_engine_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_service_stub.endpoint + config.universe_domain = @reasoning_engine_service_stub.universe_domain + config.logger = @reasoning_engine_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @reasoning_engine_service_stub.logger + end + + # Service calls + + ## + # Creates a reasoning engine. + # + # @overload create_reasoning_engine(request, options = nil) + # Pass arguments to `create_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_reasoning_engine(parent: nil, reasoning_engine: nil) + # Pass arguments to `create_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to create the ReasoningEngine + # in. Format: `projects/{project}/locations/{location}` + # @param reasoning_engine [::Google::Cloud::AIPlatform::V1::ReasoningEngine, ::Hash] + # Required. The ReasoningEngine to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest.new + # + # # Call the create_reasoning_engine method. + # result = client.create_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.call_rpc :create_reasoning_engine, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a reasoning engine. + # + # @overload get_reasoning_engine(request, options = nil) + # Pass arguments to `get_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_reasoning_engine(name: nil) + # Pass arguments to `get_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest.new + # + # # Call the get_reasoning_engine method. + # result = client.get_reasoning_engine request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReasoningEngine. + # p result + # + def get_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.call_rpc :get_reasoning_engine, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists reasoning engines in a location. + # + # @overload list_reasoning_engines(request, options = nil) + # Pass arguments to `list_reasoning_engines` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_reasoning_engines(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reasoning_engines` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the ReasoningEngines + # from. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. The standard list filter. + # More detail in [AIP-160](https://google.aip.dev/160). + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ReasoningEngine>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ReasoningEngine>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest.new + # + # # Call the list_reasoning_engines method. + # result = client.list_reasoning_engines request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::AIPlatform::V1::ReasoningEngine. + # p item + # end + # + def list_reasoning_engines request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_reasoning_engines.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_reasoning_engines.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_reasoning_engines.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.call_rpc :list_reasoning_engines, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @reasoning_engine_service_stub, :list_reasoning_engines, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a reasoning engine. + # + # @overload update_reasoning_engine(request, options = nil) + # Pass arguments to `update_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_reasoning_engine(reasoning_engine: nil, update_mask: nil) + # Pass arguments to `update_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param reasoning_engine [::Google::Cloud::AIPlatform::V1::ReasoningEngine, ::Hash] + # Required. The ReasoningEngine which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest.new + # + # # Call the update_reasoning_engine method. + # result = client.update_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.reasoning_engine&.name + header_params["reasoning_engine.name"] = request.reasoning_engine.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.call_rpc :update_reasoning_engine, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reasoning engine. + # + # @overload delete_reasoning_engine(request, options = nil) + # Pass arguments to `delete_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_reasoning_engine(name: nil) + # Pass arguments to `delete_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest.new + # + # # Call the delete_reasoning_engine method. + # result = client.delete_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_reasoning_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.call_rpc :delete_reasoning_engine, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ReasoningEngineService API. + # + # This class represents the configuration for ReasoningEngineService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_reasoning_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_reasoning_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_reasoning_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ReasoningEngineService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reasoning_engine + ## + # RPC-specific configuration for `get_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reasoning_engine + ## + # RPC-specific configuration for `list_reasoning_engines` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reasoning_engines + ## + # RPC-specific configuration for `update_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :update_reasoning_engine + ## + # RPC-specific configuration for `delete_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reasoning_engine + + # @private + def initialize parent_rpcs = nil + create_reasoning_engine_config = parent_rpcs.create_reasoning_engine if parent_rpcs.respond_to? :create_reasoning_engine + @create_reasoning_engine = ::Gapic::Config::Method.new create_reasoning_engine_config + get_reasoning_engine_config = parent_rpcs.get_reasoning_engine if parent_rpcs.respond_to? :get_reasoning_engine + @get_reasoning_engine = ::Gapic::Config::Method.new get_reasoning_engine_config + list_reasoning_engines_config = parent_rpcs.list_reasoning_engines if parent_rpcs.respond_to? :list_reasoning_engines + @list_reasoning_engines = ::Gapic::Config::Method.new list_reasoning_engines_config + update_reasoning_engine_config = parent_rpcs.update_reasoning_engine if parent_rpcs.respond_to? :update_reasoning_engine + @update_reasoning_engine = ::Gapic::Config::Method.new update_reasoning_engine_config + delete_reasoning_engine_config = parent_rpcs.delete_reasoning_engine if parent_rpcs.respond_to? :delete_reasoning_engine + @delete_reasoning_engine = ::Gapic::Config::Method.new delete_reasoning_engine_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/credentials.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/credentials.rb new file mode 100644 index 000000000000..286ee59b610d --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + # Credentials for the ReasoningEngineService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/operations.rb new file mode 100644 index 000000000000..19d66bd8a1fb --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/operations.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ReasoningEngineService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/paths.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/paths.rb new file mode 100644 index 000000000000..b1fda620a119 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + # Path helper methods for the ReasoningEngineService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified ReasoningEngine resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # + # @param project [String] + # @param location [String] + # @param reasoning_engine [String] + # + # @return [::String] + def reasoning_engine_path project:, location:, reasoning_engine: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reasoningEngines/#{reasoning_engine}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest.rb new file mode 100644 index 000000000000..4196ebfbf94f --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/ai_platform/v1/version" +require "google/cloud/ai_platform/v1/bindings_override" + +require "google/cloud/ai_platform/v1/reasoning_engine_service/credentials" +require "google/cloud/ai_platform/v1/reasoning_engine_service/paths" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest/operations" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # A service for managing Vertex AI's Reasoning Engines. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/reasoning_engine_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + module ReasoningEngineService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/client.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/client.rb new file mode 100644 index 000000000000..7f4e23bb9b02 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/client.rb @@ -0,0 +1,862 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/aiplatform/v1/reasoning_engine_service_pb" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + module Rest + ## + # REST client for the ReasoningEngineService service. + # + # A service for managing Vertex AI's Reasoning Engines. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :reasoning_engine_service_stub + + ## + # Configure the ReasoningEngineService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ReasoningEngineService clients + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AIPlatform", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @reasoning_engine_service_stub.universe_domain + end + + ## + # Create a new ReasoningEngineService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ReasoningEngineService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @reasoning_engine_service_stub = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @reasoning_engine_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_service_stub.endpoint + config.universe_domain = @reasoning_engine_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @reasoning_engine_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @reasoning_engine_service_stub.endpoint + config.universe_domain = @reasoning_engine_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @reasoning_engine_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @reasoning_engine_service_stub.logger + end + + # Service calls + + ## + # Creates a reasoning engine. + # + # @overload create_reasoning_engine(request, options = nil) + # Pass arguments to `create_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_reasoning_engine(parent: nil, reasoning_engine: nil) + # Pass arguments to `create_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to create the ReasoningEngine + # in. Format: `projects/{project}/locations/{location}` + # @param reasoning_engine [::Google::Cloud::AIPlatform::V1::ReasoningEngine, ::Hash] + # Required. The ReasoningEngine to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest.new + # + # # Call the create_reasoning_engine method. + # result = client.create_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.create_reasoning_engine request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a reasoning engine. + # + # @overload get_reasoning_engine(request, options = nil) + # Pass arguments to `get_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_reasoning_engine(name: nil) + # Pass arguments to `get_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest.new + # + # # Call the get_reasoning_engine method. + # result = client.get_reasoning_engine request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::ReasoningEngine. + # p result + # + def get_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.get_reasoning_engine request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists reasoning engines in a location. + # + # @overload list_reasoning_engines(request, options = nil) + # Pass arguments to `list_reasoning_engines` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_reasoning_engines(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reasoning_engines` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the Location to list the ReasoningEngines + # from. Format: `projects/{project}/locations/{location}` + # @param filter [::String] + # Optional. The standard list filter. + # More detail in [AIP-160](https://google.aip.dev/160). + # @param page_size [::Integer] + # Optional. The standard list page size. + # @param page_token [::String] + # Optional. The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ReasoningEngine>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ReasoningEngine>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest.new + # + # # Call the list_reasoning_engines method. + # result = client.list_reasoning_engines request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::AIPlatform::V1::ReasoningEngine. + # p item + # end + # + def list_reasoning_engines request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_reasoning_engines.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_reasoning_engines.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_reasoning_engines.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.list_reasoning_engines request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @reasoning_engine_service_stub, :list_reasoning_engines, "reasoning_engines", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a reasoning engine. + # + # @overload update_reasoning_engine(request, options = nil) + # Pass arguments to `update_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_reasoning_engine(reasoning_engine: nil, update_mask: nil) + # Pass arguments to `update_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param reasoning_engine [::Google::Cloud::AIPlatform::V1::ReasoningEngine, ::Hash] + # Required. The ReasoningEngine which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Mask specifying which fields to update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest.new + # + # # Call the update_reasoning_engine method. + # result = client.update_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.update_reasoning_engine request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reasoning engine. + # + # @overload delete_reasoning_engine(request, options = nil) + # Pass arguments to `delete_reasoning_engine` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_reasoning_engine(name: nil) + # Pass arguments to `delete_reasoning_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the ReasoningEngine resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/ai_platform/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest.new + # + # # Call the delete_reasoning_engine method. + # result = client.delete_reasoning_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_reasoning_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_reasoning_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_reasoning_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_reasoning_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @reasoning_engine_service_stub.delete_reasoning_engine request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ReasoningEngineService REST API. + # + # This class represents the configuration for ReasoningEngineService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_reasoning_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_reasoning_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_reasoning_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ReasoningEngineService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reasoning_engine + ## + # RPC-specific configuration for `get_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reasoning_engine + ## + # RPC-specific configuration for `list_reasoning_engines` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reasoning_engines + ## + # RPC-specific configuration for `update_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :update_reasoning_engine + ## + # RPC-specific configuration for `delete_reasoning_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reasoning_engine + + # @private + def initialize parent_rpcs = nil + create_reasoning_engine_config = parent_rpcs.create_reasoning_engine if parent_rpcs.respond_to? :create_reasoning_engine + @create_reasoning_engine = ::Gapic::Config::Method.new create_reasoning_engine_config + get_reasoning_engine_config = parent_rpcs.get_reasoning_engine if parent_rpcs.respond_to? :get_reasoning_engine + @get_reasoning_engine = ::Gapic::Config::Method.new get_reasoning_engine_config + list_reasoning_engines_config = parent_rpcs.list_reasoning_engines if parent_rpcs.respond_to? :list_reasoning_engines + @list_reasoning_engines = ::Gapic::Config::Method.new list_reasoning_engines_config + update_reasoning_engine_config = parent_rpcs.update_reasoning_engine if parent_rpcs.respond_to? :update_reasoning_engine + @update_reasoning_engine = ::Gapic::Config::Method.new update_reasoning_engine_config + delete_reasoning_engine_config = parent_rpcs.delete_reasoning_engine if parent_rpcs.respond_to? :delete_reasoning_engine + @delete_reasoning_engine = ::Gapic::Config::Method.new delete_reasoning_engine_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/operations.rb new file mode 100644 index 000000000000..a0acb5e012fd --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/operations.rb @@ -0,0 +1,4293 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ReasoningEngineService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the ReasoningEngineService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDeploymentJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeDevices/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensionControllers/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/extensions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelMonitors/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/savedQueries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/annotationSpecs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dataItems/[^/]+/annotations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/deploymentResourcePools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/endpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featurestores/[^/]+/entityTypes/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/customJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataLabelingJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/hyperparameterTuningJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/artifacts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/contexts/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/metadataStores/[^/]+/executions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/modelDeploymentMonitoringJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/migratableResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/evaluations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookExecutionJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/studies/[^/]+/trials/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/trainingPipelines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/persistentResources/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pipelineJobs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/schedules/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/specialistPools/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/service_stub.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/service_stub.rb new file mode 100644 index 000000000000..c6299a9b54db --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/aiplatform/v1/reasoning_engine_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + module Rest + ## + # REST service stub for the ReasoningEngineService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_reasoning_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_reasoning_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # A result object deserialized from the server's reply + def get_reasoning_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_reasoning_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ReasoningEngine.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_reasoning_engines REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesResponse] + # A result object deserialized from the server's reply + def list_reasoning_engines request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_reasoning_engines_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_reasoning_engines", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_reasoning_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_reasoning_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_reasoning_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_reasoning_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_reasoning_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/reasoningEngines", + body: "reasoning_engine", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_reasoning_engines REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_reasoning_engines_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/reasoningEngines", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{reasoning_engine.name}", + body: "reasoning_engine", + matches: [ + ["reasoning_engine.name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_reasoning_engine REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_reasoning_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/rest.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/rest.rb index 42082cc19471..abc95ab44a49 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/rest.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/rest.rb @@ -40,6 +40,8 @@ require "google/cloud/ai_platform/v1/notebook_service/rest" require "google/cloud/ai_platform/v1/persistent_resource_service/rest" require "google/cloud/ai_platform/v1/pipeline_service/rest" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest" require "google/cloud/ai_platform/v1/schedule_service/rest" require "google/cloud/ai_platform/v1/specialist_pool_service/rest" require "google/cloud/ai_platform/v1/tensorboard_service/rest" diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb index 19b482ad5662..015420002ea1 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb index cf7cff986ad2..bcf88c193ac6 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb index a6f2e3955d56..4aa07668e16d 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb index 49f04f2c7956..b2c07834cc88 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb index 547012738e6c..8e6917c76ed7 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb @@ -1510,6 +1510,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/notebookRuntimeTemplates/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -2203,6 +2210,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2861,6 +2875,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3512,6 +3533,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -4142,6 +4170,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/ragCorpora/[^/]+/ragFiles/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb.rb new file mode 100644 index 000000000000..ebf635500040 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/httpbody_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\nCgoogle/cloud/aiplatform/v1/reasoning_engine_execution_service.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xa6\x01\n\x1bQueryReasoningEngineRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ReasoningEngine\x12+\n\x05input\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x19\n\x0c\x63lass_method\x18\x03 \x01(\tB\x03\xe0\x41\x01\"F\n\x1cQueryReasoningEngineResponse\x12&\n\x06output\x18\x01 \x01(\x0b\x32\x16.google.protobuf.Value\"\xac\x01\n!StreamQueryReasoningEngineRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ReasoningEngine\x12+\n\x05input\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x19\n\x0c\x63lass_method\x18\x03 \x01(\tB\x03\xe0\x41\x01\x32\x86\x04\n\x1fReasoningEngineExecutionService\x12\xd0\x01\n\x14QueryReasoningEngine\x12\x37.google.cloud.aiplatform.v1.QueryReasoningEngineRequest\x1a\x38.google.cloud.aiplatform.v1.QueryReasoningEngineResponse\"E\x82\xd3\xe4\x93\x02?\":/v1/{name=projects/*/locations/*/reasoningEngines/*}:query:\x01*\x12\xc0\x01\n\x1aStreamQueryReasoningEngine\x12=.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest\x1a\x14.google.api.HttpBody\"K\x82\xd3\xe4\x93\x02\x45\"@/v1/{name=projects/*/locations/*/reasoningEngines/*}:streamQuery:\x01*0\x01\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B$ReasoningEngineExecutionServiceProtoP\x01Z>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb\xaa\x02\x1aGoogle.Cloud.AIPlatform.V1\xca\x02\x1aGoogle\\Cloud\\AIPlatform\\V1\xea\x02\x1dGoogle::Cloud::AIPlatform::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + QueryReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QueryReasoningEngineRequest").msgclass + QueryReasoningEngineResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.QueryReasoningEngineResponse").msgclass + StreamQueryReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest").msgclass + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb.rb new file mode 100644 index 000000000000..ce8325112dfe --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineExecutionService + # A service for executing queries on Reasoning Engine. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.ReasoningEngineExecutionService' + + # Queries using a reasoning engine. + rpc :QueryReasoningEngine, ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest, ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse + # Streams queries using a reasoning engine. + rpc :StreamQueryReasoningEngine, ::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest, stream(::Google::Api::HttpBody) + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_pb.rb new file mode 100644 index 000000000000..8059d41dd6e4 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/reasoning_engine.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n1google/cloud/aiplatform/v1/reasoning_engine.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\x02\n\x13ReasoningEngineSpec\x12V\n\x0cpackage_spec\x18\x02 \x01(\x0b\x32;.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpecB\x03\xe0\x41\x02\x12\x33\n\rclass_methods\x18\x03 \x03(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x1a\x98\x01\n\x0bPackageSpec\x12\"\n\x15pickle_object_gcs_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18\x64\x65pendency_files_gcs_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14requirements_gcs_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0epython_version\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xbe\x03\n\x0fReasoningEngine\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x42\n\x04spec\x18\x03 \x01(\x0b\x32/.google.cloud.aiplatform.v1.ReasoningEngineSpecB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x01:\x9f\x01\xea\x41\x9b\x01\n)aiplatform.googleapis.com/ReasoningEngine\x12Kprojects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}*\x10reasoningEngines2\x0freasoningEngineB\xd2\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x14ReasoningEngineProtoP\x01Z>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb\xaa\x02\x1aGoogle.Cloud.AIPlatform.V1\xca\x02\x1aGoogle\\Cloud\\AIPlatform\\V1\xea\x02\x1dGoogle::Cloud::AIPlatform::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + ReasoningEngineSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngineSpec").msgclass + ReasoningEngineSpec::PackageSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec").msgclass + ReasoningEngine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngine").msgclass + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_pb.rb new file mode 100644 index 000000000000..ef03facb120f --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/reasoning_engine_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/operation_pb' +require 'google/cloud/aiplatform/v1/reasoning_engine_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n9google/cloud/aiplatform/v1/reasoning_engine_service.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/cloud/aiplatform/v1/operation.proto\x1a\x31google/cloud/aiplatform/v1/reasoning_engine.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa5\x01\n\x1c\x43reateReasoningEngineRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12J\n\x10reasoning_engine\x18\x02 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ReasoningEngineB\x03\xe0\x41\x02\"x\n&CreateReasoningEngineOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\\\n\x19GetReasoningEngineRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ReasoningEngine\"\xa0\x01\n\x1cUpdateReasoningEngineRequest\x12J\n\x10reasoning_engine\x18\x01 \x01(\x0b\x32+.google.cloud.aiplatform.v1.ReasoningEngineB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"x\n&UpdateReasoningEngineOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"\x9e\x01\n\x1bListReasoningEnginesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x7f\n\x1cListReasoningEnginesResponse\x12\x46\n\x11reasoning_engines\x18\x01 \x03(\x0b\x32+.google.cloud.aiplatform.v1.ReasoningEngine\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"_\n\x1c\x44\x65leteReasoningEngineRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ReasoningEngine2\xaf\n\n\x16ReasoningEngineService\x12\x97\x02\n\x15\x43reateReasoningEngine\x12\x38.google.cloud.aiplatform.v1.CreateReasoningEngineRequest\x1a\x1d.google.longrunning.Operation\"\xa4\x01\xca\x41\x39\n\x0fReasoningEngine\x12&CreateReasoningEngineOperationMetadata\xda\x41\x17parent,reasoning_engine\x82\xd3\xe4\x93\x02H\"4/v1/{parent=projects/*/locations/*}/reasoningEngines:\x10reasoning_engine\x12\xbd\x01\n\x12GetReasoningEngine\x12\x35.google.cloud.aiplatform.v1.GetReasoningEngineRequest\x1a+.google.cloud.aiplatform.v1.ReasoningEngine\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/reasoningEngines/*}\x12\xd0\x01\n\x14ListReasoningEngines\x12\x37.google.cloud.aiplatform.v1.ListReasoningEnginesRequest\x1a\x38.google.cloud.aiplatform.v1.ListReasoningEnginesResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/reasoningEngines\x12\xad\x02\n\x15UpdateReasoningEngine\x12\x38.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest\x1a\x1d.google.longrunning.Operation\"\xba\x01\xca\x41\x39\n\x0fReasoningEngine\x12&UpdateReasoningEngineOperationMetadata\xda\x41\x1creasoning_engine,update_mask\x82\xd3\xe4\x93\x02Y2E/v1/{reasoning_engine.name=projects/*/locations/*/reasoningEngines/*}:\x10reasoning_engine\x12\xe8\x01\n\x15\x44\x65leteReasoningEngine\x12\x38.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v1/{name=projects/*/locations/*/reasoningEngines/*}\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd9\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x1bReasoningEngineServiceProtoP\x01Z>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb\xaa\x02\x1aGoogle.Cloud.AIPlatform.V1\xca\x02\x1aGoogle\\Cloud\\AIPlatform\\V1\xea\x02\x1dGoogle::Cloud::AIPlatform::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.aiplatform.v1.ReasoningEngine", "google/cloud/aiplatform/v1/reasoning_engine.proto"], + ["google.cloud.aiplatform.v1.GenericOperationMetadata", "google/cloud/aiplatform/v1/operation.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AIPlatform + module V1 + CreateReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateReasoningEngineRequest").msgclass + CreateReasoningEngineOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata").msgclass + GetReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetReasoningEngineRequest").msgclass + UpdateReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateReasoningEngineRequest").msgclass + UpdateReasoningEngineOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata").msgclass + ListReasoningEnginesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListReasoningEnginesRequest").msgclass + ListReasoningEnginesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListReasoningEnginesResponse").msgclass + DeleteReasoningEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteReasoningEngineRequest").msgclass + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_services_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_services_pb.rb new file mode 100644 index 000000000000..697fdd08ee07 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/reasoning_engine_service_services_pb.rb @@ -0,0 +1,53 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/reasoning_engine_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/aiplatform/v1/reasoning_engine_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module ReasoningEngineService + # A service for managing Vertex AI's Reasoning Engines. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.ReasoningEngineService' + + # Creates a reasoning engine. + rpc :CreateReasoningEngine, ::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest, ::Google::Longrunning::Operation + # Gets a reasoning engine. + rpc :GetReasoningEngine, ::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest, ::Google::Cloud::AIPlatform::V1::ReasoningEngine + # Lists reasoning engines in a location. + rpc :ListReasoningEngines, ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest, ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesResponse + # Updates a reasoning engine. + rpc :UpdateReasoningEngine, ::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest, ::Google::Longrunning::Operation + # Deletes a reasoning engine. + rpc :DeleteReasoningEngine, ::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine.rb new file mode 100644 index 000000000000..409726a7fccd --- /dev/null +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # ReasoningEngine configurations + # @!attribute [rw] package_spec + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngineSpec::PackageSpec] + # Required. User provided package spec of the ReasoningEngine. + # @!attribute [rw] class_methods + # @return [::Array<::Google::Protobuf::Struct>] + # Optional. Declarations for object class methods in OpenAPI specification + # format. + class ReasoningEngineSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # User provided package spec like pickled object and package requirements. + # @!attribute [rw] pickle_object_gcs_uri + # @return [::String] + # Optional. The Cloud Storage URI of the pickled python object. + # @!attribute [rw] dependency_files_gcs_uri + # @return [::String] + # Optional. The Cloud Storage URI of the dependency files in tar.gz format. + # @!attribute [rw] requirements_gcs_uri + # @return [::String] + # Optional. The Cloud Storage URI of the `requirements.txt` file + # @!attribute [rw] python_version + # @return [::String] + # Optional. The Python version. Currently support 3.8, 3.9, 3.10, 3.11. + # If not specified, default value is 3.10. + class PackageSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # ReasoningEngine provides a customizable runtime for models to determine + # which actions to take and in which order. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the ReasoningEngine. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the ReasoningEngine. + # @!attribute [rw] description + # @return [::String] + # Optional. The description of the ReasoningEngine. + # @!attribute [rw] spec + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngineSpec] + # Required. Configurations of the ReasoningEngine + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this ReasoningEngine was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this ReasoningEngine was most recently updated. + # @!attribute [rw] etag + # @return [::String] + # Optional. Used to perform consistent read-modify-write updates. If not set, + # a blind "overwrite" update happens. + class ReasoningEngine + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_execution_service.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_execution_service.rb new file mode 100644 index 000000000000..17ce13dc7d3c --- /dev/null +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_execution_service.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for [ReasoningEngineExecutionService.Query][]. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @!attribute [rw] input + # @return [::Google::Protobuf::Struct] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @!attribute [rw] class_method + # @return [::String] + # Optional. Class method to be used for the query. + # It is optional and defaults to "query" if unspecified. + class QueryReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for [ReasoningEngineExecutionService.Query][] + # @!attribute [rw] output + # @return [::Google::Protobuf::Value] + # Response provided by users in JSON object format. + class QueryReasoningEngineResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for [ReasoningEngineExecutionService.StreamQuery][]. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the ReasoningEngine resource to use. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @!attribute [rw] input + # @return [::Google::Protobuf::Struct] + # Optional. Input content provided by users in JSON object format. Examples + # include text query, function calling parameters, media bytes, etc. + # @!attribute [rw] class_method + # @return [::String] + # Optional. Class method to be used for the stream query. + # It is optional and defaults to "stream_query" if unspecified. + class StreamQueryReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_service.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_service.rb new file mode 100644 index 000000000000..d990e865352d --- /dev/null +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_service.rb @@ -0,0 +1,136 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AIPlatform + module V1 + # Request message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#create_reasoning_engine ReasoningEngineService.CreateReasoningEngine}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to create the ReasoningEngine + # in. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] reasoning_engine + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # Required. The ReasoningEngine to create. + class CreateReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#create_reasoning_engine ReasoningEngineService.CreateReasoningEngine} + # operation. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class CreateReasoningEngineOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#get_reasoning_engine ReasoningEngineService.GetReasoningEngine}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the ReasoningEngine resource. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + class GetReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#update_reasoning_engine ReasoningEngineService.UpdateReasoningEngine}. + # @!attribute [rw] reasoning_engine + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngine] + # Required. The ReasoningEngine which replaces the resource on the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Mask specifying which fields to update. + class UpdateReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#update_reasoning_engine ReasoningEngineService.UpdateReasoningEngine} + # operation. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class UpdateReasoningEngineOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#list_reasoning_engines ReasoningEngineService.ListReasoningEngines}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the Location to list the ReasoningEngines + # from. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Optional. The standard list filter. + # More detail in [AIP-160](https://google.aip.dev/160). + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The standard list page token. + class ListReasoningEnginesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#list_reasoning_engines ReasoningEngineService.ListReasoningEngines} + # @!attribute [rw] reasoning_engines + # @return [::Array<::Google::Cloud::AIPlatform::V1::ReasoningEngine>] + # List of ReasoningEngines in the requested page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # Pass to + # {::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest#page_token ListReasoningEnginesRequest.page_token} + # to obtain that page. + class ListReasoningEnginesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#delete_reasoning_engine ReasoningEngineService.DeleteReasoningEngine}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the ReasoningEngine resource to be deleted. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + class DeleteReasoningEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/snippets/reasoning_engine_execution_service/query_reasoning_engine.rb b/google-cloud-ai_platform-v1/snippets/reasoning_engine_execution_service/query_reasoning_engine.rb new file mode 100644 index 000000000000..f592d13bbba7 --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/reasoning_engine_execution_service/query_reasoning_engine.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START aiplatform_v1_generated_ReasoningEngineExecutionService_QueryReasoningEngine_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the query_reasoning_engine call in the ReasoningEngineExecutionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client#query_reasoning_engine. +# +def query_reasoning_engine + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest.new + + # Call the query_reasoning_engine method. + result = client.query_reasoning_engine request + + # The returned object is of type Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse. + p result +end +# [END aiplatform_v1_generated_ReasoningEngineExecutionService_QueryReasoningEngine_sync] diff --git a/google-cloud-ai_platform-v1/snippets/reasoning_engine_execution_service/stream_query_reasoning_engine.rb b/google-cloud-ai_platform-v1/snippets/reasoning_engine_execution_service/stream_query_reasoning_engine.rb new file mode 100644 index 000000000000..65653ad9b6ce --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/reasoning_engine_execution_service/stream_query_reasoning_engine.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START aiplatform_v1_generated_ReasoningEngineExecutionService_StreamQueryReasoningEngine_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the stream_query_reasoning_engine call in the ReasoningEngineExecutionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client#stream_query_reasoning_engine. +# +def stream_query_reasoning_engine + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest.new + + # Call the stream_query_reasoning_engine method to start streaming. + output = client.stream_query_reasoning_engine request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Api::HttpBody + output.each do |current_response| + p current_response + end +end +# [END aiplatform_v1_generated_ReasoningEngineExecutionService_StreamQueryReasoningEngine_sync] diff --git a/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/create_reasoning_engine.rb b/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/create_reasoning_engine.rb new file mode 100644 index 000000000000..13ee3bb8fcc3 --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/create_reasoning_engine.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START aiplatform_v1_generated_ReasoningEngineService_CreateReasoningEngine_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the create_reasoning_engine call in the ReasoningEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#create_reasoning_engine. +# +def create_reasoning_engine + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest.new + + # Call the create_reasoning_engine method. + result = client.create_reasoning_engine request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END aiplatform_v1_generated_ReasoningEngineService_CreateReasoningEngine_sync] diff --git a/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/delete_reasoning_engine.rb b/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/delete_reasoning_engine.rb new file mode 100644 index 000000000000..74e47a35e6e0 --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/delete_reasoning_engine.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START aiplatform_v1_generated_ReasoningEngineService_DeleteReasoningEngine_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the delete_reasoning_engine call in the ReasoningEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#delete_reasoning_engine. +# +def delete_reasoning_engine + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest.new + + # Call the delete_reasoning_engine method. + result = client.delete_reasoning_engine request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END aiplatform_v1_generated_ReasoningEngineService_DeleteReasoningEngine_sync] diff --git a/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/get_reasoning_engine.rb b/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/get_reasoning_engine.rb new file mode 100644 index 000000000000..b2c78a9995b4 --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/get_reasoning_engine.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START aiplatform_v1_generated_ReasoningEngineService_GetReasoningEngine_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the get_reasoning_engine call in the ReasoningEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#get_reasoning_engine. +# +def get_reasoning_engine + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest.new + + # Call the get_reasoning_engine method. + result = client.get_reasoning_engine request + + # The returned object is of type Google::Cloud::AIPlatform::V1::ReasoningEngine. + p result +end +# [END aiplatform_v1_generated_ReasoningEngineService_GetReasoningEngine_sync] diff --git a/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/list_reasoning_engines.rb b/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/list_reasoning_engines.rb new file mode 100644 index 000000000000..0cde34c1a012 --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/list_reasoning_engines.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START aiplatform_v1_generated_ReasoningEngineService_ListReasoningEngines_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the list_reasoning_engines call in the ReasoningEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#list_reasoning_engines. +# +def list_reasoning_engines + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest.new + + # Call the list_reasoning_engines method. + result = client.list_reasoning_engines request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::AIPlatform::V1::ReasoningEngine. + p item + end +end +# [END aiplatform_v1_generated_ReasoningEngineService_ListReasoningEngines_sync] diff --git a/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/update_reasoning_engine.rb b/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/update_reasoning_engine.rb new file mode 100644 index 000000000000..83124f8e2c87 --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/reasoning_engine_service/update_reasoning_engine.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START aiplatform_v1_generated_ReasoningEngineService_UpdateReasoningEngine_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the update_reasoning_engine call in the ReasoningEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#update_reasoning_engine. +# +def update_reasoning_engine + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest.new + + # Call the update_reasoning_engine method. + result = client.update_reasoning_engine request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END aiplatform_v1_generated_ReasoningEngineService_UpdateReasoningEngine_sync] diff --git a/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json b/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json index a0eb3031cd59..fe8a2e02fe46 100644 --- a/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json +++ b/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json @@ -9971,6 +9971,286 @@ } ] }, + { + "region_tag": "aiplatform_v1_generated_ReasoningEngineExecutionService_QueryReasoningEngine_sync", + "title": "Snippet for the query_reasoning_engine call in the ReasoningEngineExecutionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client#query_reasoning_engine.", + "file": "reasoning_engine_execution_service/query_reasoning_engine.rb", + "language": "RUBY", + "client_method": { + "short_name": "query_reasoning_engine", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client#query_reasoning_engine", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse", + "client": { + "short_name": "ReasoningEngineExecutionService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client" + }, + "method": { + "short_name": "QueryReasoningEngine", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService.QueryReasoningEngine", + "service": { + "short_name": "ReasoningEngineExecutionService", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_ReasoningEngineExecutionService_StreamQueryReasoningEngine_sync", + "title": "Snippet for the stream_query_reasoning_engine call in the ReasoningEngineExecutionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client#stream_query_reasoning_engine.", + "file": "reasoning_engine_execution_service/stream_query_reasoning_engine.rb", + "language": "RUBY", + "client_method": { + "short_name": "stream_query_reasoning_engine", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client#stream_query_reasoning_engine", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest", + "name": "request" + } + ], + "result_type": "::Google::Api::HttpBody", + "client": { + "short_name": "ReasoningEngineExecutionService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client" + }, + "method": { + "short_name": "StreamQueryReasoningEngine", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService.StreamQueryReasoningEngine", + "service": { + "short_name": "ReasoningEngineExecutionService", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_ReasoningEngineService_CreateReasoningEngine_sync", + "title": "Snippet for the create_reasoning_engine call in the ReasoningEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#create_reasoning_engine.", + "file": "reasoning_engine_service/create_reasoning_engine.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_reasoning_engine", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#create_reasoning_engine", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ReasoningEngineService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client" + }, + "method": { + "short_name": "CreateReasoningEngine", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineService.CreateReasoningEngine", + "service": { + "short_name": "ReasoningEngineService", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_ReasoningEngineService_GetReasoningEngine_sync", + "title": "Snippet for the get_reasoning_engine call in the ReasoningEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#get_reasoning_engine.", + "file": "reasoning_engine_service/get_reasoning_engine.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_reasoning_engine", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#get_reasoning_engine", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AIPlatform::V1::ReasoningEngine", + "client": { + "short_name": "ReasoningEngineService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client" + }, + "method": { + "short_name": "GetReasoningEngine", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineService.GetReasoningEngine", + "service": { + "short_name": "ReasoningEngineService", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_ReasoningEngineService_ListReasoningEngines_sync", + "title": "Snippet for the list_reasoning_engines call in the ReasoningEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#list_reasoning_engines.", + "file": "reasoning_engine_service/list_reasoning_engines.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_reasoning_engines", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#list_reasoning_engines", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AIPlatform::V1::ListReasoningEnginesResponse", + "client": { + "short_name": "ReasoningEngineService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client" + }, + "method": { + "short_name": "ListReasoningEngines", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineService.ListReasoningEngines", + "service": { + "short_name": "ReasoningEngineService", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_ReasoningEngineService_UpdateReasoningEngine_sync", + "title": "Snippet for the update_reasoning_engine call in the ReasoningEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#update_reasoning_engine.", + "file": "reasoning_engine_service/update_reasoning_engine.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_reasoning_engine", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#update_reasoning_engine", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ReasoningEngineService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client" + }, + "method": { + "short_name": "UpdateReasoningEngine", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineService.UpdateReasoningEngine", + "service": { + "short_name": "ReasoningEngineService", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_ReasoningEngineService_DeleteReasoningEngine_sync", + "title": "Snippet for the delete_reasoning_engine call in the ReasoningEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#delete_reasoning_engine.", + "file": "reasoning_engine_service/delete_reasoning_engine.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_reasoning_engine", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client#delete_reasoning_engine", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ReasoningEngineService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client" + }, + "method": { + "short_name": "DeleteReasoningEngine", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineService.DeleteReasoningEngine", + "service": { + "short_name": "ReasoningEngineService", + "full_name": "google.cloud.aiplatform.v1.ReasoningEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, { "region_tag": "aiplatform_v1_generated_ScheduleService_CreateSchedule_sync", "title": "Snippet for the create_schedule call in the ScheduleService service", diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_paths_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_paths_test.rb new file mode 100644 index 000000000000..1592f3a7cc5d --- /dev/null +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service" + +class ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_reasoning_engine_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.reasoning_engine_path project: "value0", location: "value1", reasoning_engine: "value2" + assert_equal "projects/value0/locations/value1/reasoningEngines/value2", path + end + end +end diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_rest_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_rest_test.rb new file mode 100644 index 000000000000..17b95d0edea9 --- /dev/null +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_rest_test.rb @@ -0,0 +1,211 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest" + + +class ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_query_reasoning_engine + # Create test objects. + client_result = ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + input = {} + class_method = "hello world" + + query_reasoning_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::ServiceStub.stub :transcode_query_reasoning_engine_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, query_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.query_reasoning_engine({ name: name, input: input, class_method: class_method }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.query_reasoning_engine name: name, input: input, class_method: class_method do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.query_reasoning_engine ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest.new(name: name, input: input, class_method: class_method) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.query_reasoning_engine({ name: name, input: input, class_method: class_method }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.query_reasoning_engine(::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest.new(name: name, input: input, class_method: class_method), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, query_reasoning_engine_client_stub.call_count + end + end + end + + def test_stream_query_reasoning_engine + # Create test objects. + client_result = ::Google::Api::HttpBody.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + input = {} + class_method = "hello world" + + stream_query_reasoning_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::ServiceStub.stub :transcode_stream_query_reasoning_engine_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, stream_query_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.stream_query_reasoning_engine({ name: name, input: input, class_method: class_method }) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use named arguments + client.stream_query_reasoning_engine name: name, input: input, class_method: class_method do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object + client.stream_query_reasoning_engine ::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest.new(name: name, input: input, class_method: class_method) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use hash object with options + client.stream_query_reasoning_engine({ name: name, input: input, class_method: class_method }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object with options + client.stream_query_reasoning_engine(::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest.new(name: name, input: input, class_method: class_method), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Verify method calls + assert_equal 5, stream_query_reasoning_engine_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Rest::Client::Configuration, config + end +end diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_test.rb new file mode 100644 index 000000000000..af4e50acdd1e --- /dev/null +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_execution_service_test.rb @@ -0,0 +1,224 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb" +require "google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb" +require "google/cloud/ai_platform/v1/reasoning_engine_execution_service" + +class ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_query_reasoning_engine + # Create GRPC objects. + grpc_response = ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + input = {} + class_method = "hello world" + + query_reasoning_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :query_reasoning_engine, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["input"] + assert_equal "hello world", request["class_method"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, query_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.query_reasoning_engine({ name: name, input: input, class_method: class_method }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.query_reasoning_engine name: name, input: input, class_method: class_method do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.query_reasoning_engine ::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest.new(name: name, input: input, class_method: class_method) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.query_reasoning_engine({ name: name, input: input, class_method: class_method }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.query_reasoning_engine(::Google::Cloud::AIPlatform::V1::QueryReasoningEngineRequest.new(name: name, input: input, class_method: class_method), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, query_reasoning_engine_client_stub.call_rpc_count + end + end + + def test_stream_query_reasoning_engine + # Create GRPC objects. + grpc_response = ::Google::Api::HttpBody.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + name = "hello world" + input = {} + class_method = "hello world" + + stream_query_reasoning_engine_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :stream_query_reasoning_engine, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["input"] + assert_equal "hello world", request["class_method"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stream_query_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stream_query_reasoning_engine({ name: name, input: input, class_method: class_method }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Api::HttpBody, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.stream_query_reasoning_engine name: name, input: input, class_method: class_method do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Api::HttpBody, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.stream_query_reasoning_engine ::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest.new(name: name, input: input, class_method: class_method) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Api::HttpBody, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.stream_query_reasoning_engine({ name: name, input: input, class_method: class_method }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Api::HttpBody, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.stream_query_reasoning_engine(::Google::Cloud::AIPlatform::V1::StreamQueryReasoningEngineRequest.new(name: name, input: input, class_method: class_method), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Api::HttpBody, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, stream_query_reasoning_engine_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client::Configuration, config + end +end diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_operations_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_operations_test.rb new file mode 100644 index 000000000000..1a23154ea0e0 --- /dev/null +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_operations_test.rb @@ -0,0 +1,398 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/aiplatform/v1/reasoning_engine_service_pb" +require "google/cloud/aiplatform/v1/reasoning_engine_service_services_pb" +require "google/cloud/ai_platform/v1/reasoning_engine_service" + +class ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Operations::Configuration, config + end +end diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_paths_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_paths_test.rb new file mode 100644 index 000000000000..70c5e2ad23a1 --- /dev/null +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/ai_platform/v1/reasoning_engine_service" + +class ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_reasoning_engine_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.reasoning_engine_path project: "value0", location: "value1", reasoning_engine: "value2" + assert_equal "projects/value0/locations/value1/reasoningEngines/value2", path + end + end +end diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_rest_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_rest_test.rb new file mode 100644 index 000000000000..659d66454207 --- /dev/null +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_rest_test.rb @@ -0,0 +1,374 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/aiplatform/v1/reasoning_engine_service_pb" +require "google/cloud/ai_platform/v1/reasoning_engine_service/rest" + + +class ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_reasoning_engine + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + reasoning_engine = {} + + create_reasoning_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::ServiceStub.stub :transcode_create_reasoning_engine_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_reasoning_engine({ parent: parent, reasoning_engine: reasoning_engine }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_reasoning_engine parent: parent, reasoning_engine: reasoning_engine do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_reasoning_engine ::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest.new(parent: parent, reasoning_engine: reasoning_engine) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_reasoning_engine({ parent: parent, reasoning_engine: reasoning_engine }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_reasoning_engine(::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest.new(parent: parent, reasoning_engine: reasoning_engine), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_reasoning_engine_client_stub.call_count + end + end + end + + def test_get_reasoning_engine + # Create test objects. + client_result = ::Google::Cloud::AIPlatform::V1::ReasoningEngine.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_reasoning_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::ServiceStub.stub :transcode_get_reasoning_engine_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_reasoning_engine({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_reasoning_engine name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_reasoning_engine ::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_reasoning_engine({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_reasoning_engine(::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_reasoning_engine_client_stub.call_count + end + end + end + + def test_list_reasoning_engines + # Create test objects. + client_result = ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_reasoning_engines_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::ServiceStub.stub :transcode_list_reasoning_engines_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_reasoning_engines_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_reasoning_engines({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_reasoning_engines parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_reasoning_engines ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_reasoning_engines({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_reasoning_engines(::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_reasoning_engines_client_stub.call_count + end + end + end + + def test_update_reasoning_engine + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + reasoning_engine = {} + update_mask = {} + + update_reasoning_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::ServiceStub.stub :transcode_update_reasoning_engine_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_reasoning_engine({ reasoning_engine: reasoning_engine, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_reasoning_engine reasoning_engine: reasoning_engine, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_reasoning_engine ::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest.new(reasoning_engine: reasoning_engine, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_reasoning_engine({ reasoning_engine: reasoning_engine, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_reasoning_engine(::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest.new(reasoning_engine: reasoning_engine, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_reasoning_engine_client_stub.call_count + end + end + end + + def test_delete_reasoning_engine + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_reasoning_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::ServiceStub.stub :transcode_delete_reasoning_engine_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_reasoning_engine({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_reasoning_engine name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_reasoning_engine ::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_reasoning_engine({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_reasoning_engine(::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_reasoning_engine_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Rest::Client::Configuration, config + end +end diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_test.rb new file mode 100644 index 000000000000..7fe6387c76d0 --- /dev/null +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/reasoning_engine_service_test.rb @@ -0,0 +1,419 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/aiplatform/v1/reasoning_engine_service_pb" +require "google/cloud/aiplatform/v1/reasoning_engine_service_services_pb" +require "google/cloud/ai_platform/v1/reasoning_engine_service" + +class ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_reasoning_engine + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + reasoning_engine = {} + + create_reasoning_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_reasoning_engine, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AIPlatform::V1::ReasoningEngine), request["reasoning_engine"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_reasoning_engine({ parent: parent, reasoning_engine: reasoning_engine }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_reasoning_engine parent: parent, reasoning_engine: reasoning_engine do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_reasoning_engine ::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest.new(parent: parent, reasoning_engine: reasoning_engine) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_reasoning_engine({ parent: parent, reasoning_engine: reasoning_engine }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_reasoning_engine(::Google::Cloud::AIPlatform::V1::CreateReasoningEngineRequest.new(parent: parent, reasoning_engine: reasoning_engine), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_reasoning_engine_client_stub.call_rpc_count + end + end + + def test_get_reasoning_engine + # Create GRPC objects. + grpc_response = ::Google::Cloud::AIPlatform::V1::ReasoningEngine.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_reasoning_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_reasoning_engine, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_reasoning_engine({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_reasoning_engine name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_reasoning_engine ::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_reasoning_engine({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_reasoning_engine(::Google::Cloud::AIPlatform::V1::GetReasoningEngineRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_reasoning_engine_client_stub.call_rpc_count + end + end + + def test_list_reasoning_engines + # Create GRPC objects. + grpc_response = ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_reasoning_engines_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_reasoning_engines, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_reasoning_engines_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_reasoning_engines({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_reasoning_engines parent: parent, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_reasoning_engines ::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_reasoning_engines({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_reasoning_engines(::Google::Cloud::AIPlatform::V1::ListReasoningEnginesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_reasoning_engines_client_stub.call_rpc_count + end + end + + def test_update_reasoning_engine + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + reasoning_engine = {} + update_mask = {} + + update_reasoning_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_reasoning_engine, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AIPlatform::V1::ReasoningEngine), request["reasoning_engine"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_reasoning_engine({ reasoning_engine: reasoning_engine, update_mask: update_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_reasoning_engine reasoning_engine: reasoning_engine, update_mask: update_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_reasoning_engine ::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest.new(reasoning_engine: reasoning_engine, update_mask: update_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_reasoning_engine({ reasoning_engine: reasoning_engine, update_mask: update_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_reasoning_engine(::Google::Cloud::AIPlatform::V1::UpdateReasoningEngineRequest.new(reasoning_engine: reasoning_engine, update_mask: update_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_reasoning_engine_client_stub.call_rpc_count + end + end + + def test_delete_reasoning_engine + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_reasoning_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_reasoning_engine, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_reasoning_engine_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_reasoning_engine({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_reasoning_engine name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_reasoning_engine ::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_reasoning_engine({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_reasoning_engine(::Google::Cloud::AIPlatform::V1::DeleteReasoningEngineRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_reasoning_engine_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::AIPlatform::V1::ReasoningEngineService::Operations, client.operations_client + end +end