diff --git a/google-cloud-ai_platform-v1/.owlbot-manifest.json b/google-cloud-ai_platform-v1/.owlbot-manifest.json index f39af8cb0054..2f3e06e11204 100644 --- a/google-cloud-ai_platform-v1/.owlbot-manifest.json +++ b/google-cloud-ai_platform-v1/.owlbot-manifest.json @@ -251,6 +251,15 @@ "lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb", "lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb", "lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb", + "lib/google/cloud/ai_platform/v1/session_service.rb", + "lib/google/cloud/ai_platform/v1/session_service/client.rb", + "lib/google/cloud/ai_platform/v1/session_service/credentials.rb", + "lib/google/cloud/ai_platform/v1/session_service/operations.rb", + "lib/google/cloud/ai_platform/v1/session_service/paths.rb", + "lib/google/cloud/ai_platform/v1/session_service/rest.rb", + "lib/google/cloud/ai_platform/v1/session_service/rest/client.rb", + "lib/google/cloud/ai_platform/v1/session_service/rest/operations.rb", + "lib/google/cloud/ai_platform/v1/session_service/rest/service_stub.rb", "lib/google/cloud/ai_platform/v1/specialist_pool_service.rb", "lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb", "lib/google/cloud/ai_platform/v1/specialist_pool_service/credentials.rb", @@ -424,6 +433,9 @@ "lib/google/cloud/aiplatform/v1/schedule_service_pb.rb", "lib/google/cloud/aiplatform/v1/schedule_service_services_pb.rb", "lib/google/cloud/aiplatform/v1/service_networking_pb.rb", + "lib/google/cloud/aiplatform/v1/session_pb.rb", + "lib/google/cloud/aiplatform/v1/session_service_pb.rb", + "lib/google/cloud/aiplatform/v1/session_service_services_pb.rb", "lib/google/cloud/aiplatform/v1/specialist_pool_pb.rb", "lib/google/cloud/aiplatform/v1/specialist_pool_service_pb.rb", "lib/google/cloud/aiplatform/v1/specialist_pool_service_services_pb.rb", @@ -593,6 +605,8 @@ "proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.rb", "proto_docs/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.rb", "proto_docs/google/cloud/aiplatform/v1/service_networking.rb", + "proto_docs/google/cloud/aiplatform/v1/session.rb", + "proto_docs/google/cloud/aiplatform/v1/session_service.rb", "proto_docs/google/cloud/aiplatform/v1/specialist_pool.rb", "proto_docs/google/cloud/aiplatform/v1/specialist_pool_service.rb", "proto_docs/google/cloud/aiplatform/v1/study.rb", @@ -898,6 +912,13 @@ "snippets/schedule_service/pause_schedule.rb", "snippets/schedule_service/resume_schedule.rb", "snippets/schedule_service/update_schedule.rb", + "snippets/session_service/append_event.rb", + "snippets/session_service/create_session.rb", + "snippets/session_service/delete_session.rb", + "snippets/session_service/get_session.rb", + "snippets/session_service/list_events.rb", + "snippets/session_service/list_sessions.rb", + "snippets/session_service/update_session.rb", "snippets/snippet_metadata_google.cloud.aiplatform.v1.json", "snippets/specialist_pool_service/create_specialist_pool.rb", "snippets/specialist_pool_service/delete_specialist_pool.rb", @@ -1067,6 +1088,10 @@ "test/google/cloud/ai_platform/v1/schedule_service_paths_test.rb", "test/google/cloud/ai_platform/v1/schedule_service_rest_test.rb", "test/google/cloud/ai_platform/v1/schedule_service_test.rb", + "test/google/cloud/ai_platform/v1/session_service_operations_test.rb", + "test/google/cloud/ai_platform/v1/session_service_paths_test.rb", + "test/google/cloud/ai_platform/v1/session_service_rest_test.rb", + "test/google/cloud/ai_platform/v1/session_service_test.rb", "test/google/cloud/ai_platform/v1/specialist_pool_service_operations_test.rb", "test/google/cloud/ai_platform/v1/specialist_pool_service_paths_test.rb", "test/google/cloud/ai_platform/v1/specialist_pool_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 513bd63551e9..8a47c4583064 100644 --- a/google-cloud-ai_platform-v1/gapic_metadata.json +++ b/google-cloud-ai_platform-v1/gapic_metadata.json @@ -1602,6 +1602,50 @@ } } }, + "SessionService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AIPlatform::V1::SessionService::Client", + "rpcs": { + "CreateSession": { + "methods": [ + "create_session" + ] + }, + "GetSession": { + "methods": [ + "get_session" + ] + }, + "ListSessions": { + "methods": [ + "list_sessions" + ] + }, + "UpdateSession": { + "methods": [ + "update_session" + ] + }, + "DeleteSession": { + "methods": [ + "delete_session" + ] + }, + "ListEvents": { + "methods": [ + "list_events" + ] + }, + "AppendEvent": { + "methods": [ + "append_event" + ] + } + } + } + } + }, "SpecialistPoolService": { "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 521b68ec5a1c..803db7c5891d 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 @@ -44,6 +44,7 @@ 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/session_service" require "google/cloud/ai_platform/v1/specialist_pool_service" require "google/cloud/ai_platform/v1/tensorboard_service" require "google/cloud/ai_platform/v1/vertex_rag_data_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 b3e71e3ee407..099758954443 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 1e80642a923a..72547bd4faff 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 5c065726714f..c1f313963c15 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 030ce86a143f..bfa4a7e15325 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 83a75c094829..3e2d45fd4622 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 74194dd4a5c4..0134b285a455 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 9f051b406b78..076628d0dd30 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 28247fc925b7..9138a4fc4a70 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 616a0c5f5049..dea235301acb 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 59153c4e14f9..b24765c26f12 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 f9e02c0b9aab..dad04a6dc270 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 876ab1661119..c848b2146530 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/operations.rb index ecda16f897f1..e81c9d2709c1 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/operations.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/model_garden_service/rest/operations.rb @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 4d0cdf4fb77b..98afeee66d55 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 03f2b6d539f5..f99699ed3904 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 6725afdb4489..9721f2b10bab 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 fcbeda1df0e0..7aaf764bdad5 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb 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 index dbee3f9ee30a..039a3a03e772 100644 --- 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb 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 9d5cc91cd5bb..21943d43f257 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 @@ -44,6 +44,7 @@ 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/session_service/rest" require "google/cloud/ai_platform/v1/specialist_pool_service/rest" require "google/cloud/ai_platform/v1/tensorboard_service/rest" require "google/cloud/ai_platform/v1/vertex_rag_data_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 05f79919572f..ba9fde3b5e1e 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service.rb new file mode 100644 index 000000000000..30d27f8bb3f6 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 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/session_service/credentials" +require "google/cloud/ai_platform/v1/session_service/paths" +require "google/cloud/ai_platform/v1/session_service/operations" +require "google/cloud/ai_platform/v1/session_service/client" +require "google/cloud/ai_platform/v1/session_service/rest" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The service that manages Vertex Session related resources. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/ai_platform/v1/session_service" + # client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/ai_platform/v1/session_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new + # + module SessionService + end + end + end + end +end + +helper_path = ::File.join __dir__, "session_service", "helpers.rb" +require "google/cloud/ai_platform/v1/session_service/helpers" if ::File.file? helper_path diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/client.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/client.rb new file mode 100644 index 000000000000..c80207bf8e75 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/client.rb @@ -0,0 +1,1173 @@ +# frozen_string_literal: true + +# Copyright 2026 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/session_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AIPlatform + module V1 + module SessionService + ## + # Client for the SessionService service. + # + # The service that manages Vertex Session related resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :session_service_stub + + ## + # Configure the SessionService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::SessionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionService clients + # ::Google::Cloud::AIPlatform::V1::SessionService::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 SessionService 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::SessionService::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 + @session_service_stub.universe_domain + end + + ## + # Create a new SessionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SessionService 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/session_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 + + @session_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AIPlatform::V1::SessionService::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 + ) + + @session_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 = @session_service_stub.endpoint + config.universe_domain = @session_service_stub.universe_domain + config.logger = @session_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 = @session_service_stub.endpoint + config.universe_domain = @session_service_stub.universe_domain + config.logger = @session_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::SessionService::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 + @session_service_stub.logger + end + + # Service calls + + ## + # Creates a new {::Google::Cloud::AIPlatform::V1::Session Session}. + # + # @overload create_session(request, options = nil) + # Pass arguments to `create_session` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateSessionRequest, ::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_session(parent: nil, session: nil) + # Pass arguments to `create_session` 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 session in. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param session [::Google::Cloud::AIPlatform::V1::Session, ::Hash] + # Required. The session 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::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateSessionRequest.new + # + # # Call the create_session method. + # result = client.create_session 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_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateSessionRequest + + # 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_session.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_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :create_session, 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 details of the specific {::Google::Cloud::AIPlatform::V1::Session Session}. + # + # @overload get_session(request, options = nil) + # Pass arguments to `get_session` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetSessionRequest, ::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_session(name: nil) + # Pass arguments to `get_session` 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 resource name of the session. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Session] + # + # @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::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetSessionRequest.new + # + # # Call the get_session method. + # result = client.get_session request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Session. + # p result + # + def get_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetSessionRequest + + # 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_session.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_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :get_session, 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 {::Google::Cloud::AIPlatform::V1::Session Sessions} in a given reasoning + # engine. + # + # @overload list_sessions(request, options = nil) + # Pass arguments to `list_sessions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListSessionsRequest, ::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_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_sessions` 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 sessions from. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param page_size [::Integer] + # Optional. The maximum number of sessions to return. The service may return + # fewer than this value. If unspecified, at most 100 sessions will be + # returned. + # @param page_token [::String] + # Optional. The + # {::Google::Cloud::AIPlatform::V1::ListSessionsResponse#next_page_token next_page_token} + # value returned from a previous list + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#list_sessions SessionService.ListSessions} + # call. + # @param filter [::String] + # Optional. The standard list filter. + # Supported fields: + # * `display_name` + # * `user_id` + # * `labels` + # + # Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. Supported fields: + # * `create_time` + # * `update_time` + # + # Example: `create_time desc`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Session>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Session>] + # + # @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::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListSessionsRequest.new + # + # # Call the list_sessions method. + # result = client.list_sessions 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::Session. + # p item + # end + # + def list_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListSessionsRequest + + # 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_sessions.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_sessions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :list_sessions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @session_service_stub, :list_sessions, 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 the specific {::Google::Cloud::AIPlatform::V1::Session Session}. + # + # @overload update_session(request, options = nil) + # Pass arguments to `update_session` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateSessionRequest, ::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_session(session: nil, update_mask: nil) + # Pass arguments to `update_session` 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 session [::Google::Cloud::AIPlatform::V1::Session, ::Hash] + # Required. The session to update. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to control which fields get updated. If the + # mask is not present, all fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::Session] + # + # @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::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateSessionRequest.new + # + # # Call the update_session method. + # result = client.update_session request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Session. + # p result + # + def update_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateSessionRequest + + # 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_session.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.session&.name + header_params["session.name"] = request.session.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_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :update_session, 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 + + ## + # Deletes details of the specific + # {::Google::Cloud::AIPlatform::V1::Session Session}. + # + # @overload delete_session(request, options = nil) + # Pass arguments to `delete_session` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteSessionRequest, ::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_session(name: nil) + # Pass arguments to `delete_session` 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 resource name of the session. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # + # @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::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteSessionRequest.new + # + # # Call the delete_session method. + # result = client.delete_session 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_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteSessionRequest + + # 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_session.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_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :delete_session, 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 + + ## + # Lists {::Google::Cloud::AIPlatform::V1::Event Events} in a given session. + # + # @overload list_events(request, options = nil) + # Pass arguments to `list_events` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListEventsRequest, ::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_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_events` 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 session to list events from. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # @param page_size [::Integer] + # Optional. The maximum number of events to return. The service may return + # fewer than this value. If unspecified, at most 100 events will be returned. + # These events are ordered by timestamp in ascending order. + # @param page_token [::String] + # Optional. The + # {::Google::Cloud::AIPlatform::V1::ListEventsResponse#next_page_token next_page_token} + # value returned from a previous list + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#list_events SessionService.ListEvents} + # call. + # @param filter [::String] + # Optional. The standard list filter. + # Supported fields: + # * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where + # the timestamp is in RFC 3339 format) + # + # More detail in [AIP-160](https://google.aip.dev/160). + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. Supported fields: + # * `timestamp` + # + # Example: `timestamp desc`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SessionEvent>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SessionEvent>] + # + # @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::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListEventsRequest.new + # + # # Call the list_events method. + # result = client.list_events 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::SessionEvent. + # p item + # end + # + def list_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListEventsRequest + + # 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_events.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_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :list_events, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @session_service_stub, :list_events, 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 + + ## + # Appends an event to a given session. + # + # @overload append_event(request, options = nil) + # Pass arguments to `append_event` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AppendEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AppendEventRequest, ::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 append_event(name: nil, event: nil) + # Pass arguments to `append_event` 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 resource name of the session to append event to. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # @param event [::Google::Cloud::AIPlatform::V1::SessionEvent, ::Hash] + # Required. The event to append to the session. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AIPlatform::V1::AppendEventResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AIPlatform::V1::AppendEventResponse] + # + # @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::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AppendEventRequest.new + # + # # Call the append_event method. + # result = client.append_event request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AppendEventResponse. + # p result + # + def append_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AppendEventRequest + + # 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.append_event.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.append_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.append_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :append_event, 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 SessionService API. + # + # This class represents the configuration for SessionService, + # 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::SessionService::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_session to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::SessionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 SessionService 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_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session + ## + # RPC-specific configuration for `get_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session + ## + # RPC-specific configuration for `list_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sessions + ## + # RPC-specific configuration for `update_session` + # @return [::Gapic::Config::Method] + # + attr_reader :update_session + ## + # RPC-specific configuration for `delete_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session + ## + # RPC-specific configuration for `list_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_events + ## + # RPC-specific configuration for `append_event` + # @return [::Gapic::Config::Method] + # + attr_reader :append_event + + # @private + def initialize parent_rpcs = nil + create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session + @create_session = ::Gapic::Config::Method.new create_session_config + get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session + @get_session = ::Gapic::Config::Method.new get_session_config + list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions + @list_sessions = ::Gapic::Config::Method.new list_sessions_config + update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session + @update_session = ::Gapic::Config::Method.new update_session_config + delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session + @delete_session = ::Gapic::Config::Method.new delete_session_config + list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events + @list_events = ::Gapic::Config::Method.new list_events_config + append_event_config = parent_rpcs.append_event if parent_rpcs.respond_to? :append_event + @append_event = ::Gapic::Config::Method.new append_event_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/session_service/credentials.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/credentials.rb new file mode 100644 index 000000000000..54b38d7334fd --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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 SessionService + # Credentials for the SessionService 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/session_service/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/operations.rb new file mode 100644 index 000000000000..4181e8cca0fe --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/operations.rb @@ -0,0 +1,849 @@ +# frozen_string_literal: true + +# Copyright 2026 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 SessionService + # 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 SessionService 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 SessionService 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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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/session_service/paths.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/paths.rb new file mode 100644 index 000000000000..2ef92db4c031 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/paths.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# Copyright 2026 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 SessionService + # Path helper methods for the SessionService 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 + + ## + # Create a fully-qualified Session resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param reasoning_engine [String] + # @param session [String] + # + # @return [::String] + def session_path project:, location:, reasoning_engine:, session: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "reasoning_engine cannot contain /" if reasoning_engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reasoningEngines/#{reasoning_engine}/sessions/#{session}" + end + + ## + # Create a fully-qualified SessionEvent resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}` + # + # @param project [String] + # @param location [String] + # @param reasoning_engine [String] + # @param session [String] + # @param event [String] + # + # @return [::String] + def session_event_path project:, location:, reasoning_engine:, session:, event: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "reasoning_engine cannot contain /" if reasoning_engine.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/reasoningEngines/#{reasoning_engine}/sessions/#{session}/events/#{event}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/rest.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/rest.rb new file mode 100644 index 000000000000..cc5e38920822 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 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/session_service/credentials" +require "google/cloud/ai_platform/v1/session_service/paths" +require "google/cloud/ai_platform/v1/session_service/rest/operations" +require "google/cloud/ai_platform/v1/session_service/rest/client" + +module Google + module Cloud + module AIPlatform + module V1 + ## + # The service that manages Vertex Session related resources. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/ai_platform/v1/session_service/rest" + # client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new + # + module SessionService + # 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/session_service/rest/helpers" if ::File.file? helper_path diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/rest/client.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/rest/client.rb new file mode 100644 index 000000000000..fab183cc2ecd --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/rest/client.rb @@ -0,0 +1,1090 @@ +# frozen_string_literal: true + +# Copyright 2026 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/session_service_pb" +require "google/cloud/ai_platform/v1/session_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AIPlatform + module V1 + module SessionService + module Rest + ## + # REST client for the SessionService service. + # + # The service that manages Vertex Session related resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :session_service_stub + + ## + # Configure the SessionService Client class. + # + # See {::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionService clients + # ::Google::Cloud::AIPlatform::V1::SessionService::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 SessionService 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::SessionService::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 + @session_service_stub.universe_domain + end + + ## + # Create a new SessionService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SessionService 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::SessionService::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 + + @session_service_stub = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @session_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 = @session_service_stub.endpoint + config.universe_domain = @session_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @session_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 = @session_service_stub.endpoint + config.universe_domain = @session_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @session_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AIPlatform::V1::SessionService::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 + @session_service_stub.logger + end + + # Service calls + + ## + # Creates a new {::Google::Cloud::AIPlatform::V1::Session Session}. + # + # @overload create_session(request, options = nil) + # Pass arguments to `create_session` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::CreateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::CreateSessionRequest, ::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_session(parent: nil, session: nil) + # Pass arguments to `create_session` 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 session in. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param session [::Google::Cloud::AIPlatform::V1::Session, ::Hash] + # Required. The session 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::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::CreateSessionRequest.new + # + # # Call the create_session method. + # result = client.create_session 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_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateSessionRequest + + # 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_session.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_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.create_session 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 details of the specific {::Google::Cloud::AIPlatform::V1::Session Session}. + # + # @overload get_session(request, options = nil) + # Pass arguments to `get_session` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::GetSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::GetSessionRequest, ::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_session(name: nil) + # Pass arguments to `get_session` 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 resource name of the session. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Session] + # + # @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::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::GetSessionRequest.new + # + # # Call the get_session method. + # result = client.get_session request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Session. + # p result + # + def get_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetSessionRequest + + # 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_session.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_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.get_session 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 {::Google::Cloud::AIPlatform::V1::Session Sessions} in a given reasoning + # engine. + # + # @overload list_sessions(request, options = nil) + # Pass arguments to `list_sessions` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListSessionsRequest, ::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_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_sessions` 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 sessions from. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @param page_size [::Integer] + # Optional. The maximum number of sessions to return. The service may return + # fewer than this value. If unspecified, at most 100 sessions will be + # returned. + # @param page_token [::String] + # Optional. The + # {::Google::Cloud::AIPlatform::V1::ListSessionsResponse#next_page_token next_page_token} + # value returned from a previous list + # {::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client#list_sessions SessionService.ListSessions} + # call. + # @param filter [::String] + # Optional. The standard list filter. + # Supported fields: + # * `display_name` + # * `user_id` + # * `labels` + # + # Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. Supported fields: + # * `create_time` + # * `update_time` + # + # Example: `create_time desc`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Session>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Session>] + # + # @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::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListSessionsRequest.new + # + # # Call the list_sessions method. + # result = client.list_sessions 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::Session. + # p item + # end + # + def list_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListSessionsRequest + + # 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_sessions.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_sessions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.list_sessions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @session_service_stub, :list_sessions, "sessions", 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 the specific {::Google::Cloud::AIPlatform::V1::Session Session}. + # + # @overload update_session(request, options = nil) + # Pass arguments to `update_session` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::UpdateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::UpdateSessionRequest, ::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_session(session: nil, update_mask: nil) + # Pass arguments to `update_session` 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 session [::Google::Cloud::AIPlatform::V1::Session, ::Hash] + # Required. The session to update. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to control which fields get updated. If the + # mask is not present, all fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Session] + # + # @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::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::UpdateSessionRequest.new + # + # # Call the update_session method. + # result = client.update_session request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::Session. + # p result + # + def update_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateSessionRequest + + # 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_session.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_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.update_session 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 + + ## + # Deletes details of the specific + # {::Google::Cloud::AIPlatform::V1::Session Session}. + # + # @overload delete_session(request, options = nil) + # Pass arguments to `delete_session` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::DeleteSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::DeleteSessionRequest, ::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_session(name: nil) + # Pass arguments to `delete_session` 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 resource name of the session. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # @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::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::DeleteSessionRequest.new + # + # # Call the delete_session method. + # result = client.delete_session 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_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteSessionRequest + + # 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_session.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_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.delete_session 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 + + ## + # Lists {::Google::Cloud::AIPlatform::V1::Event Events} in a given session. + # + # @overload list_events(request, options = nil) + # Pass arguments to `list_events` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::ListEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::ListEventsRequest, ::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_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_events` 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 session to list events from. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # @param page_size [::Integer] + # Optional. The maximum number of events to return. The service may return + # fewer than this value. If unspecified, at most 100 events will be returned. + # These events are ordered by timestamp in ascending order. + # @param page_token [::String] + # Optional. The + # {::Google::Cloud::AIPlatform::V1::ListEventsResponse#next_page_token next_page_token} + # value returned from a previous list + # {::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client#list_events SessionService.ListEvents} + # call. + # @param filter [::String] + # Optional. The standard list filter. + # Supported fields: + # * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where + # the timestamp is in RFC 3339 format) + # + # More detail in [AIP-160](https://google.aip.dev/160). + # @param order_by [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. Supported fields: + # * `timestamp` + # + # Example: `timestamp desc`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SessionEvent>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::SessionEvent>] + # + # @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::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::ListEventsRequest.new + # + # # Call the list_events method. + # result = client.list_events 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::SessionEvent. + # p item + # end + # + def list_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListEventsRequest + + # 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_events.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_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.list_events request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @session_service_stub, :list_events, "session_events", 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 + + ## + # Appends an event to a given session. + # + # @overload append_event(request, options = nil) + # Pass arguments to `append_event` via a request object, either of type + # {::Google::Cloud::AIPlatform::V1::AppendEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AIPlatform::V1::AppendEventRequest, ::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 append_event(name: nil, event: nil) + # Pass arguments to `append_event` 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 resource name of the session to append event to. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # @param event [::Google::Cloud::AIPlatform::V1::SessionEvent, ::Hash] + # Required. The event to append to the session. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AIPlatform::V1::AppendEventResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AppendEventResponse] + # + # @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::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AIPlatform::V1::AppendEventRequest.new + # + # # Call the append_event method. + # result = client.append_event request + # + # # The returned object is of type Google::Cloud::AIPlatform::V1::AppendEventResponse. + # p result + # + def append_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AppendEventRequest + + # 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.append_event.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.append_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.append_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.append_event 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 + + ## + # Configuration class for the SessionService REST API. + # + # This class represents the configuration for SessionService 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::SessionService::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_session to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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, ::Google::Auth::BaseClient, ::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 SessionService 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_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session + ## + # RPC-specific configuration for `get_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session + ## + # RPC-specific configuration for `list_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sessions + ## + # RPC-specific configuration for `update_session` + # @return [::Gapic::Config::Method] + # + attr_reader :update_session + ## + # RPC-specific configuration for `delete_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session + ## + # RPC-specific configuration for `list_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_events + ## + # RPC-specific configuration for `append_event` + # @return [::Gapic::Config::Method] + # + attr_reader :append_event + + # @private + def initialize parent_rpcs = nil + create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session + @create_session = ::Gapic::Config::Method.new create_session_config + get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session + @get_session = ::Gapic::Config::Method.new get_session_config + list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions + @list_sessions = ::Gapic::Config::Method.new list_sessions_config + update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session + @update_session = ::Gapic::Config::Method.new update_session_config + delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session + @delete_session = ::Gapic::Config::Method.new delete_session_config + list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events + @list_events = ::Gapic::Config::Method.new list_events_config + append_event_config = parent_rpcs.append_event if parent_rpcs.respond_to? :append_event + @append_event = ::Gapic::Config::Method.new append_event_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/session_service/rest/operations.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/rest/operations.rb new file mode 100644 index 000000000000..2ab1a5158ca5 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/rest/operations.rb @@ -0,0 +1,4479 @@ +# frozen_string_literal: true + +# Copyright 2026 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 SessionService + 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 SessionService 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 SessionService 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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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, ::Google::Auth::BaseClient, ::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/[^/]+/ragEngineConfig/?$}, 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: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/featureMonitors/[^/]+/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/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, 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/[^/]+/ragEngineConfig/?$}, 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] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, 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/[^/]+/ragEngineConfig/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: "/ui/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/featureMonitors/[^/]+/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/[^/]+/ragEngineConfig/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/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/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] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/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/[^/]+/ragEngineConfig/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/[^/]+/featureGroups/[^/]+/featureMonitors/[^/]+/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/[^/]+/ragEngineConfig/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/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/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] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/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/[^/]+/ragEngineConfig/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/[^/]+/ragEngineConfig/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/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/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] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/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/[^/]+/ragEngineConfig/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: "/ui/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/featureMonitors/[^/]+/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/[^/]+/ragEngineConfig/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/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/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] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/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/session_service/rest/service_stub.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/rest/service_stub.rb new file mode 100644 index 000000000000..f5cc1a5313db --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/session_service/rest/service_stub.rb @@ -0,0 +1,511 @@ +# frozen_string_literal: true + +# Copyright 2026 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/session_service_pb" + +module Google + module Cloud + module AIPlatform + module V1 + module SessionService + module Rest + ## + # REST service stub for the SessionService 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_session REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateSessionRequest] + # 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_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_session_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_session", + 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_session REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetSessionRequest] + # 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::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Session] + # A result object deserialized from the server's reply + def get_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_session_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_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Session.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_sessions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListSessionsRequest] + # 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::ListSessionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListSessionsResponse] + # A result object deserialized from the server's reply + def list_sessions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_sessions_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_sessions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListSessionsResponse.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_session REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateSessionRequest] + # 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::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::Session] + # A result object deserialized from the server's reply + def update_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_session_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_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::Session.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_session REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteSessionRequest] + # 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_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_session_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_session", + 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 list_events REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListEventsRequest] + # 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::ListEventsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::ListEventsResponse] + # A result object deserialized from the server's reply + def list_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_events_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_events", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::ListEventsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the append_event REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AppendEventRequest] + # 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::AppendEventResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AIPlatform::V1::AppendEventResponse] + # A result object deserialized from the server's reply + def append_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_append_event_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: "append_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AIPlatform::V1::AppendEventResponse.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_session REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::CreateSessionRequest] + # 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_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sessions", + body: "session", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_session REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::GetSessionRequest] + # 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_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_sessions REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListSessionsRequest] + # 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_sessions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sessions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_session REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::UpdateSessionRequest] + # 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_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{session.name}", + body: "session", + matches: [ + ["session.name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_session REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::DeleteSessionRequest] + # 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_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_events REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::ListEventsRequest] + # 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_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/events", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the append_event REST call + # + # @param request_pb [::Google::Cloud::AIPlatform::V1::AppendEventRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_append_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:appendEvent", + body: "event", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, 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/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 fbf6be19bdc4..6b8f01a81ae4 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 a91869d79a05..08aa0187bfc4 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 7f36ea80cc10..fc736898ca52 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end end 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 d1059f29721b..0298427bb36b 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 @@ -1549,6 +1549,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}/operations", @@ -1675,6 +1682,13 @@ def self.transcode_list_operations_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2277,6 +2291,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :get, uri_template: "/v1/{name}", @@ -2382,6 +2403,13 @@ def self.transcode_get_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -2963,6 +2991,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", @@ -3068,6 +3103,13 @@ def self.transcode_delete_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureOnlineStores/[^/]+/featureViews/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -3635,6 +3677,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:cancel", @@ -3705,6 +3754,13 @@ def self.transcode_cancel_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/tensorboards/[^/]+/experiments/[^/]+/runs/[^/]+/timeSeries/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb end @@ -4293,6 +4349,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) .with_bindings( uri_method: :post, uri_template: "/v1/{name}:wait", @@ -4398,6 +4461,13 @@ def self.transcode_wait_operation_request request_pb ["name", %r{^projects/[^/]+/locations/[^/]+/featureGroups/[^/]+/features/[^/]+/operations/[^/]+/?$}, false] ] ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:wait", + matches: [ + ["name", %r{^reasoningEngines/[^/]+/sessions/[^/]+/operations/[^/]+/?$}, false] + ] + ) transcoder.transcode request_pb 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 index 93d35bc4e249..0b7ba41cf63b 100644 --- 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 @@ -13,7 +13,7 @@ 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\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a(google/cloud/aiplatform/v1/env_var.proto\x1a\x33google/cloud/aiplatform/v1/service_networking.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdb\x0f\n\x13ReasoningEngineSpec\x12Z\n\x10source_code_spec\x18\x0b \x01(\x0b\x32>.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpecH\x00\x12!\n\x0fservice_account\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12V\n\x0cpackage_spec\x18\x02 \x01(\x0b\x32;.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpecB\x03\xe0\x41\x01\x12\\\n\x0f\x64\x65ployment_spec\x18\x04 \x01(\x0b\x32>.google.cloud.aiplatform.v1.ReasoningEngineSpec.DeploymentSpecB\x03\xe0\x41\x01\x12\x33\n\rclass_methods\x18\x03 \x03(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x1c\n\x0f\x61gent_framework\x18\x05 \x01(\tB\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\x1a\xae\x04\n\x0e\x44\x65ploymentSpec\x12\x34\n\x03\x65nv\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.EnvVarB\x03\xe0\x41\x01\x12\x41\n\nsecret_env\x18\x02 \x03(\x0b\x32(.google.cloud.aiplatform.v1.SecretEnvVarB\x03\xe0\x41\x01\x12Q\n\x14psc_interface_config\x18\x04 \x01(\x0b\x32..google.cloud.aiplatform.v1.PscInterfaceConfigB\x03\xe0\x41\x01\x12\x1f\n\rmin_instances\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1f\n\rmax_instances\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12p\n\x0fresource_limits\x18\x07 \x03(\x0b\x32R.google.cloud.aiplatform.v1.ReasoningEngineSpec.DeploymentSpec.ResourceLimitsEntryB\x03\xe0\x41\x01\x12\'\n\x15\x63ontainer_concurrency\x18\x08 \x01(\x05\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x1a\x35\n\x13ResourceLimitsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x10\n\x0e_min_instancesB\x10\n\x0e_max_instancesB\x18\n\x16_container_concurrency\x1a\xc6\x06\n\x0eSourceCodeSpec\x12\x64\n\rinline_source\x18\x01 \x01(\x0b\x32K.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSourceH\x00\x12y\n\x18\x64\x65veloper_connect_source\x18\x03 \x01(\x0b\x32U.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.DeveloperConnectSourceH\x00\x12`\n\x0bpython_spec\x18\x02 \x01(\x0b\x32I.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.PythonSpecH\x01\x1a.\n\x0cInlineSource\x12\x1e\n\x0esource_archive\x18\x01 \x01(\x0c\x42\x06\xe0\x41\x02\xe0\x41\x04\x1a\x99\x01\n\x16\x44\x65veloperConnectConfig\x12V\n\x13git_repository_link\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1developerconnect.googleapis.com/GitRepositoryLink\x12\x10\n\x03\x64ir\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08revision\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x84\x01\n\x16\x44\x65veloperConnectSource\x12j\n\x06\x63onfig\x18\x01 \x01(\x0b\x32U.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.DeveloperConnectConfigB\x03\xe0\x41\x02\x1a\x82\x01\n\nPythonSpec\x12\x14\n\x07version\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x65ntrypoint_module\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x65ntrypoint_object\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11requirements_file\x18\x04 \x01(\tB\x03\xe0\x41\x01\x42\x08\n\x06sourceB\x0f\n\rlanguage_specB\x13\n\x11\x64\x65ployment_sourceB\x12\n\x10_service_account\"\xfb\x04\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\x01\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\x12\x43\n\x0f\x65ncryption_spec\x18\x0b \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12G\n\x06labels\x18\x11 \x03(\x0b\x32\x37.google.cloud.aiplatform.v1.ReasoningEngine.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x9f\x01\xea\x41\x9b\x01\n)aiplatform.googleapis.com/ReasoningEngine\x12Kprojects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}*\x10reasoningEngines2\x0freasoningEngineB\xf4\x02\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::V1\xea\x41\x9e\x01\n1developerconnect.googleapis.com/GitRepositoryLink\x12iprojects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link}b\x06proto3" +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\x30google/cloud/aiplatform/v1/encryption_spec.proto\x1a(google/cloud/aiplatform/v1/env_var.proto\x1a\x33google/cloud/aiplatform/v1/service_networking.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf2\x11\n\x13ReasoningEngineSpec\x12Z\n\x10source_code_spec\x18\x0b \x01(\x0b\x32>.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpecH\x00\x12!\n\x0fservice_account\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12V\n\x0cpackage_spec\x18\x02 \x01(\x0b\x32;.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpecB\x03\xe0\x41\x01\x12\\\n\x0f\x64\x65ployment_spec\x18\x04 \x01(\x0b\x32>.google.cloud.aiplatform.v1.ReasoningEngineSpec.DeploymentSpecB\x03\xe0\x41\x01\x12\x33\n\rclass_methods\x18\x03 \x03(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x1c\n\x0f\x61gent_framework\x18\x05 \x01(\tB\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\x1a\xae\x04\n\x0e\x44\x65ploymentSpec\x12\x34\n\x03\x65nv\x18\x01 \x03(\x0b\x32\".google.cloud.aiplatform.v1.EnvVarB\x03\xe0\x41\x01\x12\x41\n\nsecret_env\x18\x02 \x03(\x0b\x32(.google.cloud.aiplatform.v1.SecretEnvVarB\x03\xe0\x41\x01\x12Q\n\x14psc_interface_config\x18\x04 \x01(\x0b\x32..google.cloud.aiplatform.v1.PscInterfaceConfigB\x03\xe0\x41\x01\x12\x1f\n\rmin_instances\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1f\n\rmax_instances\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12p\n\x0fresource_limits\x18\x07 \x03(\x0b\x32R.google.cloud.aiplatform.v1.ReasoningEngineSpec.DeploymentSpec.ResourceLimitsEntryB\x03\xe0\x41\x01\x12\'\n\x15\x63ontainer_concurrency\x18\x08 \x01(\x05\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x1a\x35\n\x13ResourceLimitsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x10\n\x0e_min_instancesB\x10\n\x0e_max_instancesB\x18\n\x16_container_concurrency\x1a\xdd\x08\n\x0eSourceCodeSpec\x12\x64\n\rinline_source\x18\x01 \x01(\x0b\x32K.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSourceH\x00\x12y\n\x18\x64\x65veloper_connect_source\x18\x03 \x01(\x0b\x32U.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.DeveloperConnectSourceH\x00\x12`\n\x0bpython_spec\x18\x02 \x01(\x0b\x32I.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.PythonSpecH\x01\x12\x63\n\nimage_spec\x18\x05 \x01(\x0b\x32H.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpecB\x03\xe0\x41\x01H\x01\x1a.\n\x0cInlineSource\x12\x1e\n\x0esource_archive\x18\x01 \x01(\x0c\x42\x06\xe0\x41\x02\xe0\x41\x04\x1a\xaf\x01\n\tImageSpec\x12p\n\nbuild_args\x18\x01 \x03(\x0b\x32W.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec.BuildArgsEntryB\x03\xe0\x41\x01\x1a\x30\n\x0e\x42uildArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x99\x01\n\x16\x44\x65veloperConnectConfig\x12V\n\x13git_repository_link\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1developerconnect.googleapis.com/GitRepositoryLink\x12\x10\n\x03\x64ir\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08revision\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x84\x01\n\x16\x44\x65veloperConnectSource\x12j\n\x06\x63onfig\x18\x01 \x01(\x0b\x32U.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.DeveloperConnectConfigB\x03\xe0\x41\x02\x1a\x82\x01\n\nPythonSpec\x12\x14\n\x07version\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x65ntrypoint_module\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x65ntrypoint_object\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11requirements_file\x18\x04 \x01(\tB\x03\xe0\x41\x01\x42\x08\n\x06sourceB\x0f\n\rlanguage_specB\x13\n\x11\x64\x65ployment_sourceB\x12\n\x10_service_account\"\xfb\x04\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\x01\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\x12\x43\n\x0f\x65ncryption_spec\x18\x0b \x01(\x0b\x32*.google.cloud.aiplatform.v1.EncryptionSpec\x12G\n\x06labels\x18\x11 \x03(\x0b\x32\x37.google.cloud.aiplatform.v1.ReasoningEngine.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x9f\x01\xea\x41\x9b\x01\n)aiplatform.googleapis.com/ReasoningEngine\x12Kprojects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}*\x10reasoningEngines2\x0freasoningEngineB\xf4\x02\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::V1\xea\x41\x9e\x01\n1developerconnect.googleapis.com/GitRepositoryLink\x12iprojects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link}b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -53,6 +53,7 @@ module V1 ReasoningEngineSpec::DeploymentSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngineSpec.DeploymentSpec").msgclass ReasoningEngineSpec::SourceCodeSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec").msgclass ReasoningEngineSpec::SourceCodeSpec::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSource").msgclass + ReasoningEngineSpec::SourceCodeSpec::ImageSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec").msgclass ReasoningEngineSpec::SourceCodeSpec::DeveloperConnectConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.DeveloperConnectConfig").msgclass ReasoningEngineSpec::SourceCodeSpec::DeveloperConnectSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.DeveloperConnectSource").msgclass ReasoningEngineSpec::SourceCodeSpec::PythonSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.PythonSpec").msgclass diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/session_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/session_pb.rb new file mode 100644 index 000000000000..f424ce789d96 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/session_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/session.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/aiplatform/v1/content_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n(google/cloud/aiplatform/v1/session.proto\x12\x1agoogle.cloud.aiplatform.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/aiplatform/v1/content.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf6\x04\n\x07Session\x12\x36\n\x0b\x65xpire_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12\x30\n\x03ttl\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x06\xe0\x41\x01\xe0\x41\x04H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12?\n\x06labels\x18\x08 \x03(\x0b\x32/.google.cloud.aiplatform.v1.Session.LabelsEntry\x12\x33\n\rsession_state\x18\n \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x17\n\x07user_id\x18\x0c \x01(\tB\x06\xe0\x41\x05\xe0\x41\x02\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x9a\x01\xea\x41\x96\x01\n!aiplatform.googleapis.com/Session\x12^projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}*\x08sessions2\x07sessionB\x0c\n\nexpiration\"\xb9\x04\n\x0cSessionEvent\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x13\n\x06\x61uthor\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x07\x63ontent\x18\x04 \x01(\x0b\x32#.google.cloud.aiplatform.v1.ContentB\x03\xe0\x41\x01\x12\x1a\n\rinvocation_id\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12>\n\x07\x61\x63tions\x18\x06 \x01(\x0b\x32(.google.cloud.aiplatform.v1.EventActionsB\x03\xe0\x41\x01\x12\x32\n\ttimestamp\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x17\n\nerror_code\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rerror_message\x18\n \x01(\tB\x03\xe0\x41\x01\x12\x46\n\x0e\x65vent_metadata\x18\x0b \x01(\x0b\x32).google.cloud.aiplatform.v1.EventMetadataB\x03\xe0\x41\x01:\xb8\x01\xea\x41\xb4\x01\n&aiplatform.googleapis.com/SessionEvent\x12mprojects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}*\rsessionEvents2\x0csessionEvent\"\xb1\x03\n\rEventMetadata\x12N\n\x12grounding_metadata\x18\x01 \x01(\x0b\x32-.google.cloud.aiplatform.v1.GroundingMetadataB\x03\xe0\x41\x01\x12\x14\n\x07partial\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rturn_complete\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x0binterrupted\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\"\n\x15long_running_tool_ids\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x62ranch\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x30\n\x0f\x63ustom_metadata\x18\x07 \x01(\x0b\x32\x17.google.protobuf.Struct\x12K\n\x13input_transcription\x18\n \x01(\x0b\x32).google.cloud.aiplatform.v1.TranscriptionB\x03\xe0\x41\x01\x12L\n\x14output_transcription\x18\x0b \x01(\x0b\x32).google.cloud.aiplatform.v1.TranscriptionB\x03\xe0\x41\x01\"\xe4\x02\n\x0c\x45ventActions\x12\x1f\n\x12skip_summarization\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x31\n\x0bstate_delta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12X\n\x0e\x61rtifact_delta\x18\x03 \x03(\x0b\x32;.google.cloud.aiplatform.v1.EventActions.ArtifactDeltaEntryB\x03\xe0\x41\x01\x12\x15\n\x08\x65scalate\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12<\n\x16requested_auth_configs\x18\x07 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x1b\n\x0etransfer_agent\x18\x08 \x01(\tB\x03\xe0\x41\x01\x1a\x34\n\x12\x41rtifactDeltaEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\"9\n\rTranscription\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x66inished\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x42\xca\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x0cSessionProtoP\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.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.cloud.aiplatform.v1.Content", "google/cloud/aiplatform/v1/content.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 + Session = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Session").msgclass + SessionEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.SessionEvent").msgclass + EventMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EventMetadata").msgclass + EventActions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.EventActions").msgclass + Transcription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.Transcription").msgclass + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/session_service_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/session_service_pb.rb new file mode 100644 index 000000000000..42cefb33a30f --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/session_service_pb.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/aiplatform/v1/session_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/session_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n0google/cloud/aiplatform/v1/session_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(google/cloud/aiplatform/v1/session.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x94\x01\n\x14\x43reateSessionRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ReasoningEngine\x12\x39\n\x07session\x18\x02 \x01(\x0b\x32#.google.cloud.aiplatform.v1.SessionB\x03\xe0\x41\x02\"p\n\x1e\x43reateSessionOperationMetadata\x12N\n\x10generic_metadata\x18\x01 \x01(\x0b\x32\x34.google.cloud.aiplatform.v1.GenericOperationMetadata\"L\n\x11GetSessionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Session\"\xb5\x01\n\x13ListSessionsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)aiplatform.googleapis.com/ReasoningEngine\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"f\n\x14ListSessionsResponse\x12\x35\n\x08sessions\x18\x01 \x03(\x0b\x32#.google.cloud.aiplatform.v1.Session\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x87\x01\n\x14UpdateSessionRequest\x12\x39\n\x07session\x18\x01 \x01(\x0b\x32#.google.cloud.aiplatform.v1.SessionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"O\n\x14\x44\x65leteSessionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Session\"\xab\x01\n\x11ListEventsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Session\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"o\n\x12ListEventsResponse\x12@\n\x0esession_events\x18\x01 \x03(\x0b\x32(.google.cloud.aiplatform.v1.SessionEvent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8b\x01\n\x12\x41ppendEventRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!aiplatform.googleapis.com/Session\x12<\n\x05\x65vent\x18\x02 \x01(\x0b\x32(.google.cloud.aiplatform.v1.SessionEventB\x03\xe0\x41\x02\"\x15\n\x13\x41ppendEventResponse2\xae\x0c\n\x0eSessionService\x12\xf0\x01\n\rCreateSession\x12\x30.google.cloud.aiplatform.v1.CreateSessionRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41)\n\x07Session\x12\x1e\x43reateSessionOperationMetadata\xda\x41\x0eparent,session\x82\xd3\xe4\x93\x02J\"?/v1/{parent=projects/*/locations/*/reasoningEngines/*}/sessions:\x07session\x12\xb0\x01\n\nGetSession\x12-.google.cloud.aiplatform.v1.GetSessionRequest\x1a#.google.cloud.aiplatform.v1.Session\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}\x12\xc3\x01\n\x0cListSessions\x12/.google.cloud.aiplatform.v1.ListSessionsRequest\x1a\x30.google.cloud.aiplatform.v1.ListSessionsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/locations/*/reasoningEngines/*}/sessions\x12\xd6\x01\n\rUpdateSession\x12\x30.google.cloud.aiplatform.v1.UpdateSessionRequest\x1a#.google.cloud.aiplatform.v1.Session\"n\xda\x41\x13session,update_mask\x82\xd3\xe4\x93\x02R2G/v1/{session.name=projects/*/locations/*/reasoningEngines/*/sessions/*}:\x07session\x12\xe4\x01\n\rDeleteSession\x12\x30.google.cloud.aiplatform.v1.DeleteSessionRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17\x44\x65leteOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41*?/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}\x12\xc6\x01\n\nListEvents\x12-.google.cloud.aiplatform.v1.ListEventsRequest\x1a..google.cloud.aiplatform.v1.ListEventsResponse\"Y\xda\x41\x06parent\x82\xd3\xe4\x93\x02J\x12H/v1/{parent=projects/*/locations/*/reasoningEngines/*/sessions/*}/events\x12\xd7\x01\n\x0b\x41ppendEvent\x12..google.cloud.aiplatform.v1.AppendEventRequest\x1a/.google.cloud.aiplatform.v1.AppendEventResponse\"g\xda\x41\nname,event\x82\xd3\xe4\x93\x02T\"K/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}:appendEvent:\x05\x65vent\x1aM\xca\x41\x19\x61iplatform.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd1\x01\n\x1e\x63om.google.cloud.aiplatform.v1B\x13SessionServiceProtoP\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.Session", "google/cloud/aiplatform/v1/session.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 + CreateSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateSessionRequest").msgclass + CreateSessionOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.CreateSessionOperationMetadata").msgclass + GetSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.GetSessionRequest").msgclass + ListSessionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListSessionsRequest").msgclass + ListSessionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListSessionsResponse").msgclass + UpdateSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.UpdateSessionRequest").msgclass + DeleteSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.DeleteSessionRequest").msgclass + ListEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListEventsRequest").msgclass + ListEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.ListEventsResponse").msgclass + AppendEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AppendEventRequest").msgclass + AppendEventResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.aiplatform.v1.AppendEventResponse").msgclass + end + end + end +end diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/session_service_services_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/session_service_services_pb.rb new file mode 100644 index 000000000000..3e8a01a816c7 --- /dev/null +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/session_service_services_pb.rb @@ -0,0 +1,59 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/aiplatform/v1/session_service.proto for package 'Google.Cloud.AIPlatform.V1' +# Original file comments: +# Copyright 2026 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/session_service_pb' + +module Google + module Cloud + module AIPlatform + module V1 + module SessionService + # The service that manages Vertex Session related resources. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.aiplatform.v1.SessionService' + + # Creates a new [Session][google.cloud.aiplatform.v1.Session]. + rpc :CreateSession, ::Google::Cloud::AIPlatform::V1::CreateSessionRequest, ::Google::Longrunning::Operation + # Gets details of the specific [Session][google.cloud.aiplatform.v1.Session]. + rpc :GetSession, ::Google::Cloud::AIPlatform::V1::GetSessionRequest, ::Google::Cloud::AIPlatform::V1::Session + # Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning + # engine. + rpc :ListSessions, ::Google::Cloud::AIPlatform::V1::ListSessionsRequest, ::Google::Cloud::AIPlatform::V1::ListSessionsResponse + # Updates the specific [Session][google.cloud.aiplatform.v1.Session]. + rpc :UpdateSession, ::Google::Cloud::AIPlatform::V1::UpdateSessionRequest, ::Google::Cloud::AIPlatform::V1::Session + # Deletes details of the specific + # [Session][google.cloud.aiplatform.v1.Session]. + rpc :DeleteSession, ::Google::Cloud::AIPlatform::V1::DeleteSessionRequest, ::Google::Longrunning::Operation + # Lists [Events][google.cloud.aiplatform.v1.Event] in a given session. + rpc :ListEvents, ::Google::Cloud::AIPlatform::V1::ListEventsRequest, ::Google::Cloud::AIPlatform::V1::ListEventsResponse + # Appends an event to a given session. + rpc :AppendEvent, ::Google::Cloud::AIPlatform::V1::AppendEventRequest, ::Google::Cloud::AIPlatform::V1::AppendEventResponse + 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 index 2668124918f9..ed37a9f8774e 100644 --- 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 @@ -146,6 +146,13 @@ class ResourceLimitsEntry # @!attribute [rw] python_spec # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngineSpec::SourceCodeSpec::PythonSpec] # Configuration for a Python application. + # + # Note: The following fields are mutually exclusive: `python_spec`, `image_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] image_spec + # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngineSpec::SourceCodeSpec::ImageSpec] + # Optional. Configuration for building an image with custom config file. + # + # Note: The following fields are mutually exclusive: `image_spec`, `python_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. class SourceCodeSpec include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -160,6 +167,26 @@ class InlineSource extend ::Google::Protobuf::MessageExts::ClassMethods end + # The image spec for building an image (within a single build step), based + # on the config file (i.e. Dockerfile) in the source directory. + # @!attribute [rw] build_args + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Build arguments to be used. They will be passed through + # --build-arg flags. + class ImageSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class BuildArgsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + # Specifies the configuration for fetching source code from a Git # repository that is managed by Developer Connect. This includes the # repository, revision, and directory to use. diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/session.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/session.rb new file mode 100644 index 000000000000..15f6005ea166 --- /dev/null +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/session.rb @@ -0,0 +1,212 @@ +# frozen_string_literal: true + +# Copyright 2026 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 + # A session contains a set of actions between users and Vertex agents. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp of when this session is considered expired. + # This is *always* provided on output, regardless of what was sent + # on input. + # The minimum value is 24 hours from the time of creation. + # + # Note: The following fields are mutually exclusive: `expire_time`, `ttl`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Optional. Input only. The TTL for this session. + # The minimum value is 24 hours. + # + # Note: The following fields are mutually exclusive: `ttl`, `expire_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the session. + # Format: + # 'projects/\\{project}/locations/\\{location}/reasoningEngines/\\{reasoning_engine}/sessions/\\{session}'. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the session was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the session was updated. + # @!attribute [rw] display_name + # @return [::String] + # Optional. The display name of the session. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels with user-defined metadata to organize your Sessions. + # + # Label keys and values can be no longer than 64 characters + # (Unicode codepoints), can only contain lowercase letters, numeric + # characters, underscores and dashes. International characters are allowed. + # + # See https://goo.gl/xmQnxf for more information and examples of labels. + # @!attribute [rw] session_state + # @return [::Google::Protobuf::Struct] + # Optional. Session specific memory which stores key conversation points. + # @!attribute [rw] user_id + # @return [::String] + # Required. Immutable. String id provided by the user + class Session + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # An event represents a message from either the user or agent. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the event. + # Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`. + # @!attribute [rw] author + # @return [::String] + # Required. The name of the agent that sent the event, or user. + # @!attribute [rw] content + # @return [::Google::Cloud::AIPlatform::V1::Content] + # Optional. Content of the event provided by the author. + # @!attribute [rw] invocation_id + # @return [::String] + # Required. The invocation id of the event, multiple events can have the same + # invocation id. + # @!attribute [rw] actions + # @return [::Google::Cloud::AIPlatform::V1::EventActions] + # Optional. Actions executed by the agent. + # @!attribute [rw] timestamp + # @return [::Google::Protobuf::Timestamp] + # Required. Timestamp when the event was created on client side. + # @!attribute [rw] error_code + # @return [::String] + # Optional. Error code if the response is an error. Code varies by model. + # @!attribute [rw] error_message + # @return [::String] + # Optional. Error message if the response is an error. + # @!attribute [rw] event_metadata + # @return [::Google::Cloud::AIPlatform::V1::EventMetadata] + # Optional. Metadata relating to this event. + class SessionEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata relating to a LLM response event. + # @!attribute [rw] grounding_metadata + # @return [::Google::Cloud::AIPlatform::V1::GroundingMetadata] + # Optional. Metadata returned to client when grounding is enabled. + # @!attribute [rw] partial + # @return [::Boolean] + # Optional. Indicates whether the text content is part of a unfinished text + # stream. Only used for streaming mode and when the content is plain text. + # @!attribute [rw] turn_complete + # @return [::Boolean] + # Optional. Indicates whether the response from the model is complete. + # Only used for streaming mode. + # @!attribute [rw] interrupted + # @return [::Boolean] + # Optional. Flag indicating that LLM was interrupted when generating the + # content. Usually it's due to user interruption during a bidi streaming. + # @!attribute [rw] long_running_tool_ids + # @return [::Array<::String>] + # Optional. Set of ids of the long running function calls. + # Agent client will know from this field about which function call is long + # running. Only valid for function call event. + # @!attribute [rw] branch + # @return [::String] + # Optional. The branch of the event. + # The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of + # agent_2, and agent_2 is the parent of agent_3. + # Branch is used when multiple child agents shouldn't see their siblings' + # conversation history. + # @!attribute [rw] custom_metadata + # @return [::Google::Protobuf::Struct] + # The custom metadata of the LlmResponse. + # @!attribute [rw] input_transcription + # @return [::Google::Cloud::AIPlatform::V1::Transcription] + # Optional. Audio transcription of user input. + # @!attribute [rw] output_transcription + # @return [::Google::Cloud::AIPlatform::V1::Transcription] + # Optional. Audio transcription of model output. + class EventMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Actions are parts of events that are executed by the agent. + # @!attribute [rw] skip_summarization + # @return [::Boolean] + # Optional. If true, it won't call model to summarize function response. + # Only used for function_response event. + # @!attribute [rw] state_delta + # @return [::Google::Protobuf::Struct] + # Optional. Indicates that the event is updating the state with the given + # delta. + # @!attribute [rw] artifact_delta + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # Optional. Indicates that the event is updating an artifact. key is the + # filename, value is the version. + # @!attribute [rw] escalate + # @return [::Boolean] + # Optional. The agent is escalating to a higher level agent. + # @!attribute [rw] requested_auth_configs + # @return [::Google::Protobuf::Struct] + # Optional. Will only be set by a tool response indicating tool request euc. + # Struct key is the function call id since one function call response (from + # model) could correspond to multiple function calls. Struct value is the + # required auth config, which can be another struct. + # @!attribute [rw] transfer_agent + # @return [::String] + # Optional. If set, the event transfers to the specified agent. + class EventActions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class ArtifactDeltaEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Audio transcription in Server Content. + # @!attribute [rw] text + # @return [::String] + # Optional. Transcription text. + # @!attribute [rw] finished + # @return [::Boolean] + # Optional. The bool indicates the end of the transcription. + class Transcription + 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/session_service.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/session_service.rb new file mode 100644 index 000000000000..2918abc12161 --- /dev/null +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/session_service.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 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::SessionService::Client#create_session SessionService.CreateSession}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location to create the session in. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @!attribute [rw] session + # @return [::Google::Cloud::AIPlatform::V1::Session] + # Required. The session to create. + class CreateSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata associated with the + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#create_session SessionService.CreateSession} + # operation. + # @!attribute [rw] generic_metadata + # @return [::Google::Cloud::AIPlatform::V1::GenericOperationMetadata] + # The common part of the operation metadata. + class CreateSessionOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#get_session SessionService.GetSession}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the session. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + class GetSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#list_sessions SessionService.ListSessions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location to list sessions from. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of sessions to return. The service may return + # fewer than this value. If unspecified, at most 100 sessions will be + # returned. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The + # {::Google::Cloud::AIPlatform::V1::ListSessionsResponse#next_page_token next_page_token} + # value returned from a previous list + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#list_sessions SessionService.ListSessions} + # call. + # @!attribute [rw] filter + # @return [::String] + # Optional. The standard list filter. + # Supported fields: + # * `display_name` + # * `user_id` + # * `labels` + # + # Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. + # @!attribute [rw] order_by + # @return [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. Supported fields: + # * `create_time` + # * `update_time` + # + # Example: `create_time desc`. + class ListSessionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#list_sessions SessionService.ListSessions}. + # @!attribute [rw] sessions + # @return [::Array<::Google::Cloud::AIPlatform::V1::Session>] + # A list of sessions matching the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListSessionsRequest#page_token ListSessionsRequest.page_token} + # to retrieve the next page. Absence of this field indicates there are no + # subsequent pages. + class ListSessionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#update_session SessionService.UpdateSession}. + # @!attribute [rw] session + # @return [::Google::Cloud::AIPlatform::V1::Session] + # Required. The session to update. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to control which fields get updated. If the + # mask is not present, all fields will be updated. + class UpdateSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#delete_session SessionService.DeleteSession}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the session. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + class DeleteSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#list_events SessionService.ListEvents}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the session to list events from. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of events to return. The service may return + # fewer than this value. If unspecified, at most 100 events will be returned. + # These events are ordered by timestamp in ascending order. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The + # {::Google::Cloud::AIPlatform::V1::ListEventsResponse#next_page_token next_page_token} + # value returned from a previous list + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#list_events SessionService.ListEvents} + # call. + # @!attribute [rw] filter + # @return [::String] + # Optional. The standard list filter. + # Supported fields: + # * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where + # the timestamp is in RFC 3339 format) + # + # More detail in [AIP-160](https://google.aip.dev/160). + # @!attribute [rw] order_by + # @return [::String] + # Optional. A comma-separated list of fields to order by, sorted in ascending + # order. Use "desc" after a field name for descending. Supported fields: + # * `timestamp` + # + # Example: `timestamp desc`. + class ListEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#list_events SessionService.ListEvents}. + # @!attribute [rw] session_events + # @return [::Array<::Google::Cloud::AIPlatform::V1::SessionEvent>] + # A list of events matching the request. Ordered by timestamp in ascending + # order. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as + # {::Google::Cloud::AIPlatform::V1::ListEventsRequest#page_token ListEventsRequest.page_token} + # to retrieve the next page. Absence of this field indicates there are no + # subsequent pages. + class ListEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#append_event SessionService.AppendEvent}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the session to append event to. + # Format: + # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + # @!attribute [rw] event + # @return [::Google::Cloud::AIPlatform::V1::SessionEvent] + # Required. The event to append to the session. + class AppendEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::AIPlatform::V1::SessionService::Client#append_event SessionService.AppendEvent}. + class AppendEventResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-ai_platform-v1/snippets/session_service/append_event.rb b/google-cloud-ai_platform-v1/snippets/session_service/append_event.rb new file mode 100644 index 000000000000..06f67ab22a67 --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/session_service/append_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_SessionService_AppendEvent_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the append_event call in the SessionService 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::SessionService::Client#append_event. +# +def append_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::AppendEventRequest.new + + # Call the append_event method. + result = client.append_event request + + # The returned object is of type Google::Cloud::AIPlatform::V1::AppendEventResponse. + p result +end +# [END aiplatform_v1_generated_SessionService_AppendEvent_sync] diff --git a/google-cloud-ai_platform-v1/snippets/session_service/create_session.rb b/google-cloud-ai_platform-v1/snippets/session_service/create_session.rb new file mode 100644 index 000000000000..26d0f86ce1f3 --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/session_service/create_session.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 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_SessionService_CreateSession_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the create_session call in the SessionService 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::SessionService::Client#create_session. +# +def create_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateSessionRequest.new + + # Call the create_session method. + result = client.create_session 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_SessionService_CreateSession_sync] diff --git a/google-cloud-ai_platform-v1/snippets/session_service/delete_session.rb b/google-cloud-ai_platform-v1/snippets/session_service/delete_session.rb new file mode 100644 index 000000000000..bac509149aac --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/session_service/delete_session.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 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_SessionService_DeleteSession_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the delete_session call in the SessionService 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::SessionService::Client#delete_session. +# +def delete_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteSessionRequest.new + + # Call the delete_session method. + result = client.delete_session 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_SessionService_DeleteSession_sync] diff --git a/google-cloud-ai_platform-v1/snippets/session_service/get_session.rb b/google-cloud-ai_platform-v1/snippets/session_service/get_session.rb new file mode 100644 index 000000000000..75bac0453074 --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/session_service/get_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_SessionService_GetSession_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the get_session call in the SessionService 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::SessionService::Client#get_session. +# +def get_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetSessionRequest.new + + # Call the get_session method. + result = client.get_session request + + # The returned object is of type Google::Cloud::AIPlatform::V1::Session. + p result +end +# [END aiplatform_v1_generated_SessionService_GetSession_sync] diff --git a/google-cloud-ai_platform-v1/snippets/session_service/list_events.rb b/google-cloud-ai_platform-v1/snippets/session_service/list_events.rb new file mode 100644 index 000000000000..7039138c9a9e --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/session_service/list_events.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 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_SessionService_ListEvents_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the list_events call in the SessionService 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::SessionService::Client#list_events. +# +def list_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListEventsRequest.new + + # Call the list_events method. + result = client.list_events 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::SessionEvent. + p item + end +end +# [END aiplatform_v1_generated_SessionService_ListEvents_sync] diff --git a/google-cloud-ai_platform-v1/snippets/session_service/list_sessions.rb b/google-cloud-ai_platform-v1/snippets/session_service/list_sessions.rb new file mode 100644 index 000000000000..f0a4e724c9d8 --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/session_service/list_sessions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 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_SessionService_ListSessions_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the list_sessions call in the SessionService 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::SessionService::Client#list_sessions. +# +def list_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListSessionsRequest.new + + # Call the list_sessions method. + result = client.list_sessions 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::Session. + p item + end +end +# [END aiplatform_v1_generated_SessionService_ListSessions_sync] diff --git a/google-cloud-ai_platform-v1/snippets/session_service/update_session.rb b/google-cloud-ai_platform-v1/snippets/session_service/update_session.rb new file mode 100644 index 000000000000..f579f51e6370 --- /dev/null +++ b/google-cloud-ai_platform-v1/snippets/session_service/update_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_SessionService_UpdateSession_sync] +require "google/cloud/ai_platform/v1" + +## +# Snippet for the update_session call in the SessionService 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::SessionService::Client#update_session. +# +def update_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateSessionRequest.new + + # Call the update_session method. + result = client.update_session request + + # The returned object is of type Google::Cloud::AIPlatform::V1::Session. + p result +end +# [END aiplatform_v1_generated_SessionService_UpdateSession_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 9ed17681ddab..bedba4684e0f 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 @@ -10771,6 +10771,286 @@ } ] }, + { + "region_tag": "aiplatform_v1_generated_SessionService_CreateSession_sync", + "title": "Snippet for the create_session call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::SessionService::Client#create_session.", + "file": "session_service/create_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_session", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client#create_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::CreateSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client" + }, + "method": { + "short_name": "CreateSession", + "full_name": "google.cloud.aiplatform.v1.SessionService.CreateSession", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.aiplatform.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_SessionService_GetSession_sync", + "title": "Snippet for the get_session call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::SessionService::Client#get_session.", + "file": "session_service/get_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_session", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client#get_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::GetSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AIPlatform::V1::Session", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client" + }, + "method": { + "short_name": "GetSession", + "full_name": "google.cloud.aiplatform.v1.SessionService.GetSession", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.aiplatform.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_SessionService_ListSessions_sync", + "title": "Snippet for the list_sessions call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::SessionService::Client#list_sessions.", + "file": "session_service/list_sessions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sessions", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client#list_sessions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::ListSessionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AIPlatform::V1::ListSessionsResponse", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client" + }, + "method": { + "short_name": "ListSessions", + "full_name": "google.cloud.aiplatform.v1.SessionService.ListSessions", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.aiplatform.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_SessionService_UpdateSession_sync", + "title": "Snippet for the update_session call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::SessionService::Client#update_session.", + "file": "session_service/update_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_session", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client#update_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::UpdateSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AIPlatform::V1::Session", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client" + }, + "method": { + "short_name": "UpdateSession", + "full_name": "google.cloud.aiplatform.v1.SessionService.UpdateSession", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.aiplatform.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_SessionService_DeleteSession_sync", + "title": "Snippet for the delete_session call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::SessionService::Client#delete_session.", + "file": "session_service/delete_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_session", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client#delete_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::DeleteSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client" + }, + "method": { + "short_name": "DeleteSession", + "full_name": "google.cloud.aiplatform.v1.SessionService.DeleteSession", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.aiplatform.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_SessionService_ListEvents_sync", + "title": "Snippet for the list_events call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::SessionService::Client#list_events.", + "file": "session_service/list_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_events", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client#list_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::ListEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AIPlatform::V1::ListEventsResponse", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client" + }, + "method": { + "short_name": "ListEvents", + "full_name": "google.cloud.aiplatform.v1.SessionService.ListEvents", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.aiplatform.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "aiplatform_v1_generated_SessionService_AppendEvent_sync", + "title": "Snippet for the append_event call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AIPlatform::V1::SessionService::Client#append_event.", + "file": "session_service/append_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "append_event", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client#append_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AIPlatform::V1::AppendEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AIPlatform::V1::AppendEventResponse", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::AIPlatform::V1::SessionService::Client" + }, + "method": { + "short_name": "AppendEvent", + "full_name": "google.cloud.aiplatform.v1.SessionService.AppendEvent", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.aiplatform.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, { "region_tag": "aiplatform_v1_generated_SpecialistPoolService_CreateSpecialistPool_sync", "title": "Snippet for the create_specialist_pool call in the SpecialistPoolService service", diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_operations_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_operations_test.rb new file mode 100644 index 000000000000..b2e51bbf2d68 --- /dev/null +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 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/session_service_pb" +require "google/cloud/aiplatform/v1/session_service_services_pb" +require "google/cloud/ai_platform/v1/session_service" + +class ::Google::Cloud::AIPlatform::V1::SessionService::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" + return_partial_success = true + + 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"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::SessionService::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::SessionService::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::SessionService::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::SessionService::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::SessionService::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::SessionService::Operations::Configuration, config + end +end diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_paths_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_paths_test.rb new file mode 100644 index 000000000000..b08e030d6176 --- /dev/null +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 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/session_service" + +class ::Google::Cloud::AIPlatform::V1::SessionService::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::SessionService::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 + + def test_session_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::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", location: "value1", reasoning_engine: "value2", session: "value3" + assert_equal "projects/value0/locations/value1/reasoningEngines/value2/sessions/value3", path + end + end + + def test_session_event_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::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_event_path project: "value0", location: "value1", reasoning_engine: "value2", session: "value3", event: "value4" + assert_equal "projects/value0/locations/value1/reasoningEngines/value2/sessions/value3/events/value4", path + end + end +end diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_rest_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_rest_test.rb new file mode 100644 index 000000000000..4c8bcc21a4c1 --- /dev/null +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_rest_test.rb @@ -0,0 +1,488 @@ +# frozen_string_literal: true + +# Copyright 2026 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/session_service_pb" +require "google/cloud/ai_platform/v1/session_service/rest" + + +class ::Google::Cloud::AIPlatform::V1::SessionService::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_session + # 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" + session = {} + + create_session_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::SessionService::Rest::ServiceStub.stub :transcode_create_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_session_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_session({ parent: parent, session: session }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_session parent: parent, session: session do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_session ::Google::Cloud::AIPlatform::V1::CreateSessionRequest.new(parent: parent, session: session) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_session({ parent: parent, session: session }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_session(::Google::Cloud::AIPlatform::V1::CreateSessionRequest.new(parent: parent, session: session), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_session_client_stub.call_count + end + end + end + + def test_get_session + # Create test objects. + client_result = ::Google::Cloud::AIPlatform::V1::Session.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_session_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::SessionService::Rest::ServiceStub.stub :transcode_get_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_session_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_session({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_session name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_session ::Google::Cloud::AIPlatform::V1::GetSessionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_session({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_session(::Google::Cloud::AIPlatform::V1::GetSessionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_session_client_stub.call_count + end + end + end + + def test_list_sessions + # Create test objects. + client_result = ::Google::Cloud::AIPlatform::V1::ListSessionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_sessions_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::SessionService::Rest::ServiceStub.stub :transcode_list_sessions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_sessions_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_sessions ::Google::Cloud::AIPlatform::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_sessions(::Google::Cloud::AIPlatform::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_sessions_client_stub.call_count + end + end + end + + def test_update_session + # Create test objects. + client_result = ::Google::Cloud::AIPlatform::V1::Session.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + session = {} + update_mask = {} + + update_session_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::SessionService::Rest::ServiceStub.stub :transcode_update_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_session_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_session({ session: session, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_session session: session, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_session ::Google::Cloud::AIPlatform::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_session({ session: session, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_session(::Google::Cloud::AIPlatform::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_session_client_stub.call_count + end + end + end + + def test_delete_session + # 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_session_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::SessionService::Rest::ServiceStub.stub :transcode_delete_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_session_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_session({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_session name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_session ::Google::Cloud::AIPlatform::V1::DeleteSessionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_session({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_session(::Google::Cloud::AIPlatform::V1::DeleteSessionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_session_client_stub.call_count + end + end + end + + def test_list_events + # Create test objects. + client_result = ::Google::Cloud::AIPlatform::V1::ListEventsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_events_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::SessionService::Rest::ServiceStub.stub :transcode_list_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_events_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_events parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_events ::Google::Cloud::AIPlatform::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_events(::Google::Cloud::AIPlatform::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_events_client_stub.call_count + end + end + end + + def test_append_event + # Create test objects. + client_result = ::Google::Cloud::AIPlatform::V1::AppendEventResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + event = {} + + append_event_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::SessionService::Rest::ServiceStub.stub :transcode_append_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, append_event_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.append_event({ name: name, event: event }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.append_event name: name, event: event do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.append_event ::Google::Cloud::AIPlatform::V1::AppendEventRequest.new(name: name, event: event) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.append_event({ name: name, event: event }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.append_event(::Google::Cloud::AIPlatform::V1::AppendEventRequest.new(name: name, event: event), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, append_event_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::SessionService::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::SessionService::Rest::Client::Configuration, config + end +end diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_test.rb new file mode 100644 index 000000000000..dc885611dce3 --- /dev/null +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/session_service_test.rb @@ -0,0 +1,566 @@ +# frozen_string_literal: true + +# Copyright 2026 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/session_service_pb" +require "google/cloud/ai_platform/v1/session_service" + +class ::Google::Cloud::AIPlatform::V1::SessionService::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_session + # 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" + session = {} + + create_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_session, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::CreateSessionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AIPlatform::V1::Session), request["session"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_session_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_session({ parent: parent, session: session }) 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_session parent: parent, session: session 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_session ::Google::Cloud::AIPlatform::V1::CreateSessionRequest.new(parent: parent, session: session) 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_session({ parent: parent, session: session }, 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_session(::Google::Cloud::AIPlatform::V1::CreateSessionRequest.new(parent: parent, session: session), 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_session_client_stub.call_rpc_count + end + end + + def test_get_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::AIPlatform::V1::Session.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_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_session, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::GetSessionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_session_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_session({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_session name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_session ::Google::Cloud::AIPlatform::V1::GetSessionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_session({ 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_session(::Google::Cloud::AIPlatform::V1::GetSessionRequest.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_session_client_stub.call_rpc_count + end + end + + def test_list_sessions + # Create GRPC objects. + grpc_response = ::Google::Cloud::AIPlatform::V1::ListSessionsResponse.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" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sessions, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::ListSessionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_sessions_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_sessions ::Google::Cloud::AIPlatform::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_sessions(::Google::Cloud::AIPlatform::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_sessions_client_stub.call_rpc_count + end + end + + def test_update_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::AIPlatform::V1::Session.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. + session = {} + update_mask = {} + + update_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_session, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::UpdateSessionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AIPlatform::V1::Session), request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_session_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_session({ session: session, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_session session: session, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_session ::Google::Cloud::AIPlatform::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_session({ session: session, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_session(::Google::Cloud::AIPlatform::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_session_client_stub.call_rpc_count + end + end + + def test_delete_session + # 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_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_session, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::DeleteSessionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_session_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_session({ 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_session 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_session ::Google::Cloud::AIPlatform::V1::DeleteSessionRequest.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_session({ 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_session(::Google::Cloud::AIPlatform::V1::DeleteSessionRequest.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_session_client_stub.call_rpc_count + end + end + + def test_list_events + # Create GRPC objects. + grpc_response = ::Google::Cloud::AIPlatform::V1::ListEventsResponse.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" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_events, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::ListEventsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_events_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) 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_events parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by 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_events ::Google::Cloud::AIPlatform::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) 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_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, 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_events(::Google::Cloud::AIPlatform::V1::ListEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), 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_events_client_stub.call_rpc_count + end + end + + def test_append_event + # Create GRPC objects. + grpc_response = ::Google::Cloud::AIPlatform::V1::AppendEventResponse.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" + event = {} + + append_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :append_event, name + assert_kind_of ::Google::Cloud::AIPlatform::V1::AppendEventRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AIPlatform::V1::SessionEvent), request["event"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, append_event_client_stub do + # Create client + client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.append_event({ name: name, event: event }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.append_event name: name, event: event do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.append_event ::Google::Cloud::AIPlatform::V1::AppendEventRequest.new(name: name, event: event) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.append_event({ name: name, event: event }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.append_event(::Google::Cloud::AIPlatform::V1::AppendEventRequest.new(name: name, event: event), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, append_event_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::SessionService::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::SessionService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::AIPlatform::V1::SessionService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::AIPlatform::V1::SessionService::Client, client + assert_equal creds, client.configure.credentials + end + 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::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::AIPlatform::V1::SessionService::Operations, client.operations_client + end +end